Create an XML file from multiple lines in Google Sheets

Hello, I need to export an XML file in a server FTP, given a Google Sheet. I’m using modules Search Rows, Array Aggregator, Create XML. The data are correctly read, but the module Create XML exports only the first row. The Sheet has 2 rows.

I attach the screenshot of the Sheet, output of Array Aggregator, output of Create XML and XML configuration.

Please could you help me?

Thank you,
Francesco




Hi,

Will the Google Sheet always have just two rows? If yes, you can use array indexing to get the second value and map it in your XML.

Here’s a video which you might find useful:

Hello, thank you for your answer. No the sheet could have multiple rows.

Thank you

Okay, I see. Have you tried this approach where you use a data structure: https://www.make.com/en/help/tools/xml#example-935243-1

Yes I tried this approach, but it appears that the Create XML module only takes one piece of data at a time. In fact it makes me add item1, item2, etc.

Welcome to the Make community!

You are mapping the first item of the array:

You need to map the whole array, using this toggle:

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Hello, thank you for your help. I made the change but I have an error. I attach the error output. The output looks almost correct :sweat_smile:

I’ll also attach the screenshot of the modify I made. Sorry but I’m super beginner on Make.

Thank you


What is the error message?

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Could you please share screenshots of your scenario? Also include screenshots of any error messages, module configuration fields, and any filter settings. We need to see what you’re working with to give you the best advice.

You can upload images here using the Upload icon in the text editor:

2. Scenario Blueprint

Please export the scenario blueprint. Providing your scenario blueprint file will allow others to quickly recreate and see how you have set up the mappings in each module, and also allows us take screenshots or provide module exports of any solutions we have for you in return - this would greatly benefit you in implementing our suggestions as you can simply paste module exports back into your scenario editor!

To export your scenario blueprint, click the three dots at the bottom of the editor then choose ‘Export Blueprint’.

You can upload the file here by clicking on this button:

3. Output Bundles of Modules

Please provide the output bundles of each of the relevant modules by running the scenario (you can also get this without re-running your scenario from the History tab).

Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.

A. Upload as a Text File

Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.

You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved.

Sharing these details will make it easier for others to assist you.

I add that, the structure of the items it must be

` <item>
      <g:id>ARRAY ID</g:id>
      <g:custom_label_0>ARRAY CUSTOM LABEL</g:custom_label_0>
   </item>`

The output bundles of Create XML is

[
    null
]

Here the scenario bluprint

blueprint.json (34.9 KB)

Hello.

I solved it by generating the xml via Google App Script in Google Drive, then I transfer the XML with Make from google drive to the FTP server.

Thanks anyway for the help.

1 Like