webMethods: How to get a value from document list and use it as condition on document list with the same level

Product/components used and version/fix level:

webMethods 10.15

Detailed explanation of the problem:

person
-name
-address
-schoolDetails
- -schoolName
-schoolDetails
-schoolDetails
- -schoolName
-schoolDetails
-schoolDetails
- -schoolName
-schoolDetails
-workDetails
- -workName
-workDetails
-workDetails
- -workName
-workDetails
-workDetails
- -workName
-workDetails
person

Error messages / full error message screenshot / log file:

Question related to a free trial, or to a production (customer) instance?

and are arrays and on the same level

I need to loop over workDetails and get a value from schoolDetails/schoolName for condition at the same time.

  - If schoolDetails/schoolName="My School" then map workDetails/workName to the target.

How can I get the index/current iteration of workDetails so that I can use it to match with the index in schoolDetails?

If I understood the problem right it is probably easier to do that in a Java service, not Flow.

1 Like

Hi,

as a first step you should map the two arrays to 2 independent DocLists outside of the original document.
Then loop over the first list (schoolDetails).
Inside the loop there is a variable $iteration, which can be used for detecting the index.
With this information you can branch on the current entry of schoolDetails and then use pub.xml:queryXMLNode to question the second list (workDetails) to pick the matching entry with the value of $iteration.

See the IS Built-In-Services Reference for further informations on pub.xml:queryXMLNode.

Regards,
Holger

1 Like

Thank you Holger will definitely check this one.
Appreciate your quick response.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.