Forum Discussion

Max's avatar
Max
New Contributor II
2 years ago
Solved

Convert Mulsoft dataweave code to SnapLogic

Hello, I have the following MuleSoft code im trying to convert into SnapLogic. I have tried everything i can think of and im not getting anywhere. Also, posted below is a sample output from stored pr...
  • koryknick's avatar
    2 years ago

    Max - as usual, different developers approach a solution differently.  Here is my take on it.

    It took me a moment to realize I had to first deduplicate the dataset, which is what the Map for Unique, Sort for Unique, and Unique snaps are doing.  Then it's a pretty simple Aggregate using some conditional logic in the expressions, the the final Mapper to get everything aligned as desired.

    Note the use of nested ternary in the "Map final" to handle the No_State_Code default values.  I typically don't prefer to use nested ternary as it gets difficult to interpret pretty quickly... normally I would use the Conditional snap to handle these cases.

    Pipeline is attached.

    Hope this helps!