cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

"Sort path" based on dynamic columns // sort & diff

Henchway
Contributor

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):
image

Getting the objects and compares them:
image

Thanks and best regards
Thomas

2 REPLIES 2

Supratim
Contributor III

@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. ๐Ÿ™‚

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