How to map or get a variable field?

I need to get a field that changes every time a new order is made.
Captura de Tela 2024-04-18 às 21.47.30
Captura de Tela 2024-04-18 às 21.48.44

If the name after “fooeventsSeatNumber…” changes, you can find that there is no direct way of referencing it in a variable.

Therefore, I propose that you convert the parent property into an array first, using the built-in function toArray in an iterator module

e.g.:

{{ toArray(1.WooCommerceEventsSeatingFields) }}

Then, you should be able to create a filter:

(key) using the filter operator (string: begins with) and the comparator value of (fooeventsSeatNumber)

2 Likes

I think I am doing it wrong, could you describe the step by step, as I am not very experienced with MAKE and programming.
I will send the prints again to make it easier to understand the problem. I need to obtain the variable “fooeventsSeatNumberUfgfhfqozapkzqkmshni”: “2” but every time I receive a new order the code “fooeventsSeatNumber…” changes the letters.

Thank you very much in advance for the help.

Captura de Tela 2024-04-19 às 07.51.48



Captura de Tela 2024-04-18 às 21.47.30

Before, I was using this option to map, but I hadn’t realized that the code changed.
Captura de Tela 2024-04-19 às 08.36.34

{{map(2.metaData; “value.1.1.WooCommerceEventsSeatingFields.fooeventsSeatNumberLaltcsmanudcfentatrt”; “key”; “WooCommerceEventsOrderTickets”)}}

{{ toArray( first(map(2.metaData; "value.1.1.WooCommerceEventsSeatingFields")) ) }}

2 Likes

It is giving an error.


Captura de Tela 2024-04-19 às 15.22.46

Samliew, can you help me?