Extracting text from nested arrays

:bullseye: What is your goal?

Hello, I have received XML data via an API and am trying to map it to the fields in my Webflow Collection List.
My current problem is extracting the value 7479 from the arrays in the “Objektnummer” field. Pure text input (e.g., “Test”) works and is exported accordingly, but extracting the value using functions (get, map, flatten, first, etc.) simply does not work… I would be grateful for any help.

:camera_with_flash: Screenshots: scenario setup, module configuration, errors


This usually happens because of the way Make parses the XML.

“Objektnummer” is probably not just a simple array of numbers but likely an array of “objects”. This means that a function like first() and flatten() won’t work because you are still pointing to the outer object layer.

You can try to check the bundle output and fully expand the field. If you see an inner property, you will need to map that value instead, it would look something like: first(map(Objektnummer; _text)). Webflow usually expects plain text so remember to wrap the result in toString().

When manual text works but functions do not, it is almost always that the function is still returning a collection instead of a string.

Welcome to the Make community!

You can use my free custom app’s Simplify Nested Objects & Arrays module.

Just select the Flatten to Simple Arrays “Yes” option:

This will make it easier for you to map items from within complex XMLs.

Before:

After:

Hope this helps! If you are still having trouble, please provide more details.

@samliew

If you hover over [1], what type of data does it say it is?
The field is expecting text.
If, for example, it is a number, it might be an issue.
If it is a number, wrap it in a toString() formula.