Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Binding W/ double xml tag different Scheme ID's

Avatar

Level 1

I am having a binding issue where i want to display the StandarID if the item the binding i see available is

$.PurchaseOrder.Item[*].Product.StandardID[*]

However there are two StanardID's in the xml data but with different schemeAgencyID. this is causing it to display twice. Code Snippet below:

<Product>

        <StandardID schemeAgencyID=" ">614099645358</StandardID>

        <StandardID schemeAgencyID="9">614099645358</StandardID>

        <BuyerID>DA1270-CSB</BuyerID>

        <BillToID>DA1270-CSB</BillToID>

        <TypeCode>1</TypeCode>

        <TypeName languageCode="EN">Material</TypeName>

      </Product>

Is there a way in the binding or js to use this one <StandardID schemeAgencyID="9">?

thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 10

You can use predicates in your data binding expressions to filter results.

See here: http://blogs.adobe.com/formfeed/2008/10/data_binding_with_predicates.html

In your case it should be something like $.StandardID.[schemeAgencyID == "9"].

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

You can use predicates in your data binding expressions to filter results.

See here: http://blogs.adobe.com/formfeed/2008/10/data_binding_with_predicates.html

In your case it should be something like $.StandardID.[schemeAgencyID == "9"].