Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi! I have an xml file similar to the following:
<travelData>
<Profiles>
<Profile id=1 name="George">
<Profile id=2 name="Henry">
<Profile id=3 name="Bob">
<Profile id=4 name="Eugene">
<Profiles>
<travelDetail>
<travelSegment type="AIR" >
<Price value="205.55" currency="USD">
<ProfileReference id = 2/>
<ProfileReference id=3/>
</travelSegment>
</travelDetail>
<travelData>
To create my JSON output, I loop over the travelSegments with the profileReferences nested, and build separate transactions for each profile reference like:
"travelData":[
{"type":"AIR",
"name":"Henry",
"price":205.55,
"currency":"USD"
},
{"type":"AIR",
"name":"Bob",
"price":205.55,
"currency":"USD"
}
I've got the thmap generating
"travelData":[
{"type":"AIR",
"profileId":2,
"price":205.55,
"currency":"USD"
},
{"type":"AIR",
"profileId":3,
"price":205.55,
"currency":"USD"
}
How do I lookup the profile reference id in the Profiles array to get the name corresponding to the profileReference id?
I have tried many things including AgConcatFirstPresentValue, but it always grabs just the first value even if I filter the Profiles loop by the id = ProfileReference (at least for the ids included in the profileReference). Is there a way to get just the profile with the id in the 2nd loop?
thank you!
Hi,
I used a set variable:
Then I get this variable:
I uploaded my map.
Let me know if it meets your requirements.
Regards.
Eric
Hi,
I used a set variable:
Then I get this variable:
I uploaded my map.
Let me know if it meets your requirements.
Regards.
Eric
Thank you! It worked like a charm.