Dynamic Content Where All Parts Of A Field Key Are Not Known / Not Static

Hi,

I have a question about dynamic content where a part of a field key is not known and how it can be referenced, using two examples.

In this first example, it is easy to get the required data using dynamic content from a looper using the following DC:


For this example I use the DC: {{dc:looper:field key="name.common"}} and get the correct country displaying.

However, in the next example, the three letter currency code will change from country to country.

2023-10-11_16-28-58
If I use DC: {{dc:looper:field key="currencies.PGK.name"}} I get the expected result of Papua New Guinean kina. If I use: {{dc:looper:field key="currencies.USD.name"}} the result will be United States dollar.

However, as “PGK” or “USD” will be different for every country, is there a way of using a wildcard or regex in the DC to be able to get the correct three letters? I have tried things like: {{dc:looper:field key="currencies.*.name"}} but cannot find a way to get hold of the data.

Any ideas would be welcome,
Christopher

Hello Christopher,

Thanks for writing in! Regretfully there is no REGEX feature in the dynamic content. Actually, you should be running a looper, Looper Provider Dynamic Content {{dc:looper:field key="currencies"}} so that you can loop into the currencies for each countries.

Hope this makes sense.

Hi @ruenel,

Thank you - your help has helped me resolve what I was trying to do. Adding a div, which uses the Looper Provider{{dc:looper:field key="currencies"}} you suggested and placing the currency headline within the div using a Looper Consumer with the dynamic content {{dc:looper:field key="name"}} allowed me to get the correct currency.

Thanks for the guidance,
Christopher

Hi Christopher,

Glad that we are able to guide you on this.

Thanks

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