Hello,
I am trying to format output of array aggregator to specific XML format. If I use type: collection, I get below format:
<tetelek>
<tetel>
...
</tetel>
</tetelek>
<tetelek>
<tetel>
...
</tetel>
</tetelek>
However, I want following format, ie. tetelek is wrapper, and multiple tetel within that:
<tetelek>
<tetel>
...
</tetel>
<tetel>
...
</tetel>
</tetelek>
here’s my scenario:
blueprint:
blueprint.json (71.5 KB)
Thanks in advance!
Hello @Miklos_Bereznai,
Welcome to the Make Community!
I am not sure if this will help, but in your Array aggregator module you can try selecting Shopify Watch Orders as the Source Module instead of the Iterator module.
If that doesn’t work, the issue might be with your Data Structure in your XML module. Data Structures don’t copy over in blueprints so we wouldn’t be able to see if that’s the issue just based off the blueprint alone.
1 Like
Thanks for looking into it!
The Iterator is needed as I pull line items from Shopify module, which can be multiple items based on order.
Probably something with the XML data structure, but feels like it doesn’t want to come through…
Here’s how the XML structure looks like. Last part (tetelek) where I’d need each item within tetel element (or elements if more items)
This is the strict XML format I’d need: XML example | Szamlazz.hu API documentation
@Miklos_Bereznai
Hi, I haven’t solved it yet, but I have confirmed that if I have the following array structure, I can input it to the Cretate XML module and it will output the XML I want. I would like to know what the structure of the Array Aggregator output is.
[
{
"array": [
{
"tetelek": {
"tetel": [
{
"megnevezes": [
"Elado izé"
],
"mennyiseg": [
1
],
"mennyisegiEgyseg": [
"db"
],
"nettoEgysegar": [
10000
],
"afakulcs": [
27
],
"nettoErtek": [
10000
],
"afaErtek": [
2700
],
"bruttoErtek": [
12700
],
"megjegyzes": [
"lorem ipsum"
]
},
{
"megnevezes": [
"Elado izé 2"
],
"mennyiseg": [
2
],
"mennyisegiEgyseg": [
"db"
],
"nettoEgysegar": [
10000
],
"afakulcs": [
27
],
"nettoErtek": [
20000
],
"afaErtek": [
5400
],
"bruttoErtek": [
25400
],
"megjegyzes": [
"lorem ipsum 2"
]
}
]
}
}
],
"__IMTAGGLENGTH__": 1
}
]
@momomomonmon thanks for taking a look!
This is output of array aggregator:
[
{
"array": [
{
"tetel": [
{
"megnevezes": "FELS BBQ SZÓSZ - KLASSZIKUS",
"mennyiseg": 1,
"mennyisegiEgyseg": "db",
"nettoEgysegar": 2513.39,
"afakulcs": "27",
"nettoErtek": 2513.39,
"afaErtek": 678.61,
"bruttoErtek": 3192,
"megjegyzes": null
}
]
},
{
"tetel": [
{
"megnevezes": "FELS BBQ SZÓSZ - KOREAI",
"mennyiseg": 3,
"mennyisegiEgyseg": "db",
"nettoEgysegar": 1156.16,
"afakulcs": "176",
"nettoErtek": 3468.48,
"afaErtek": 2035.84,
"bruttoErtek": 3192,
"megjegyzes": null
}
]
}
],
"__IMTAGGLENGTH__": 2
}
]```
@Miklos_Bereznai
Thank you very much!
I also took a look at the Blueprint you posted, I haven’t tried it because I don’t use Shopify, but my guess is that the following settings will solve the problem.
- Delete Iterator module, add Repeater module. 2.
- Input the length of the data in Shopify for Repeats in Repeater module (
length({{17.data.line_items}})
)
- For Array Aggregator, use
i
of Repeater to get the value.
For your reference, I have attached an image of scenario that I created in my environment.
I am using the Parse XML module just to try it out, so it is equivalent to the Shopify module in your environment. There is no need to use the Parse XML module in your environment.
1 Like
Thanks a lot @momomomonmon
IT WORKS!!!
1 Like