Forum Discussion

bibhuti10785's avatar
bibhuti10785
New Contributor
2 years ago
Solved

Mapper to retrieve a field value from optional json path

I have to extract "pw_cc__IsoCode_2__c" when in the payload "Country_of_Installation__r" is present. Since both parent property Opportunity  and child property Country_of_Installation__r are op...
  • Aleksandar_A's avatar
    2 years ago

    Hello bibhuti10785,

    You can with the following expression in a Mapper Snap:

    jsonPath($,"..pw_cc__IsoCode_2__c") != [] ? jsonPath($,"..pw_cc__IsoCode_2__c").pop() : null

    Attached below is a sample pipeline.

    Please let me know if this helps you!

    Regards,

    Aleksandar.