cancel
Showing results for 
Search instead for 
Did you mean: 

Handling missing child nodes

gpre7086
Explorer
0 Kudos
333

Hello Friends

I'm building a process flow where I receive demographic data from Workday and after some mapping/transformation I will send it over to a travel system.

The file I receive from Workday is XML and has child nodes for home and work address. I'm mapping their elements to a flat structure - ultimately a csv.

My challenge is - if there is no home address maintained in Workday it does not send the child node (Primary_Home_Address_Group) and its elements. I'm trying to figure out how to test whether I have an element. If I do I'll pass its value, if I don't then I'll pass an empty string. Without the the child node (Primary_Home_Address_Group) my logic does not seem to work when testing for the presence of its elements.

See below. Thank you!! /Greg

Mapping structure:

Home_street_address logic below does not work if parent group Primary_Home_Address_Group is not sent.

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
SAP Mentor
SAP Mentor
0 Kudos

Hi Greg

You can use two Exists functions (a new one with Primary_Home_Address_Group as its input and your existing one with Home_Address as its input) and combine them with an And function from the Boolean group. Feed its output into your existing If function.

Regards,

Morten

gpre7086
Explorer

Hello Morten

That didn't occur to me; however after you shared it it makes perfect sense.

Thank you so much!!

/Greg

MortenWittrock
SAP Mentor
SAP Mentor
0 Kudos

Happy to help, gpre7086.

Answers (0)