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

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

@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. :slight_smile:

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