cancel
Showing results for 
Search instead for 
Did you mean: 

Doing a Lookup In SnapLogic? [Help]

JPaps
New Contributor III

Hi,

I have the following use-case and I haven’t found any way to get it done within SnapLogic. I am wondering if it is possible at all using this tool.

I have a CSV File in Snaplogic Designer with the following fields (example) $ID, $Name, $AmountPaid1, $AmountPaid2.

I also have an Excel File with the following fields: $ID, $AmountPaid2.

I want to alter the original CSV file by “looking up” the excel file and replacing the value of $AmountPaid2 (in the CSV) with the value of $AmountPaid2 from the excel file, only where $ID from the excel = $ID from the CSV.

Any suggestions?

1 ACCEPTED SOLUTION

bojanvelevski
Valued Contributor

Hi @JPaps,

Yes, developing this logic in SL is very much possible. I am attaching a sample pipeline which does exactly what you need:

Lookup_2021_10_14.slp (8.9 KB)

Regards,
Bojan

View solution in original post

16 REPLIES 16

bojanvelevski
Valued Contributor

Hi @JPaps,

Yes, developing this logic in SL is very much possible. I am attaching a sample pipeline which does exactly what you need:

Lookup_2021_10_14.slp (8.9 KB)

Regards,
Bojan

JPaps
New Contributor III

Thanks very much for your help @bojanvelevski . I have used the example in the sample pipeline that you sent and strangely enough, my output document is unchanged. The only difference is that I am joining on two fields instead of 1. I am stumped as to what is preventing this from working.

It would help to tell us why you’re joining on another field and which field, though it looks like $AmountPaid2 is the only other field you could join on. But including that field in the join does not make sense based on your description – you want to replace the value of $AmountPaid2 in the CSV because the $AmountPaid2 value in the Excel file is different, right? Joining only on $ID should be exactly what you need. The pipeline that @bojanvelevski provided does exactly what you asked, does it not?

JPaps
New Contributor III

Thanks for your response. I have simplified my use case to make it easier to communicate here. I am left outer joining on two fields instead of just one because for my use case, the unique identifier is made up of two fields since the output document has duplicate ids.

@bojanvelevski’s solution works in his sample but when I use the same logic with the exception of left outer joining on two fields (2 fields = the unique identifier), my output data is unchanged.

The unique identifier is called ID and COV. The excel that I am joining has matching ID and COV with the output document but it doesn’t seem to work.