โ11-09-2020 05:04 AM
Hi,
iโm having the following challenge:
Iโm pulling data from a REST API as well as SQL tables.
Before grabbing the actual objects, iโm grabbing โObject Typesโ from the REST API to know which tables to grab from the SQL DB.
The tables each have different columns, however what i want to achieve is to compare the data i retrieved from the REST API and the Data from the SQL Table through a DIFF.
Now the challenge here is that the Sort Path doesnโt allow me to use expressions, with which this would be fairly easy, however Iโm somewhat stuck on the matter of how to tell the diff which columns to sort on since i donโt know beforehand which ones will be coming along.
I thought i could pass a parameter through a pipeline execute with the path to sort on, however since the DIFF wonโt accept it, this will likely not be an option.
As you can see i want the pipe to be fairly generic and iโm not particularly eager creating 6 different pipes for each table.
Does anyone have a suggestion on how to tackle a situation such as this?
Trigger Pipe (getting the object types, then calling the child pipe with the individual object Types):
Getting the objects and compares them:
Thanks and best regards
Thomas
โ11-10-2020 09:19 PM
@Henchway As there are some limitation to use expression in diff snap, one work around I can think about (even though itโs might not very good approach), use Router based on the object type then add the relevant key for every diff snap. It might help you to avoid creating 6 different pipeline. ๐
โ11-17-2020 05:03 AM
Thanks, briefly i ended up doing that.
In the end, i introduced a new field to the database tables referencing the key of the items from the rest service, that way i can be sure that it will exist and that itโs sortable.
Best regards
Thomas