Mapping an array Help

I am attempting to map this array and completed the first collection with no issues, however collection 2 and 3 are not working. Can someone help me? Here is what I have so far and it keeps coming back as empty.
{{get(map(3.lineItems.customTextFields; “value”; “title”; “Please choose a design for your reversible circle (letter & number)”); 2)}}

Hi. Based on the formula you shared here, 2 things to double-check on your end:

  • Make sure you’re using the raw variable names for the keys (value, title)
  • Don’t use quotes (for keys or values)

Hope that helps

1 Like

Hi @Rubiyat

I’ve observed that the “Line item” is an array, and within this array, there is another array called “Custom Text Fields.” It seems that your current formula only functions for the initial collection. If your goal is to gather all line items with a custom field title, please follow these steps:

  1. Use an iterator to loop through all the “Line item” elements.
  2. Insert an aggregator within the iterator and apply a filter for the title “Please choose a design for your reversible circle (letter & number).”
  3. After the aggregator, use another iterator, and subsequently aggregate the results according to your requirements.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support
Visit us here
Youtube Channel

2 Likes

@Rubiyat You may want check the spacing in your title. “Please choose a design for your reversible circle (letter & number)". It appears to be doubled before the parentheses in item #2.
So it doesn’t match your filter.

Screenshot 2023-10-28 131143

1 Like

Can you give me a little more details? I have the iterator set up and the array aggregator, but still not able to map the 2 other items.

I did that purposely so it would pull the different title/value.

Hi @Rubiyat

Use iterator to separate the Line item.
Use next iterator to separate the customTextFields array next filter to check the value.

image





image

To inspect the data you have, kindly provide the JSON format of the output. This will enable us to conduct a more in-depth analysis.

2 Likes

A little bit of trial and error, but I got it to work. Thank you so much. That took me several days to finalize!

2 Likes