Creating Arrays

What are you trying to achieve?

I am trying to create a defined folder structure in Google Drive. It searches for a sub-folder based on a name, if it finds it then it moves to the next folder to create. If it does not find it then it creates the folder then moves next. I want to use an iterator to handle this loop. However I’m not able to create an array, the iterator only looks at this list as a string.

Steps taken so far

Tried using the Set Variable and also creating JSON however neither are doing what I need. See screenshots

The array I am trying to work with is this
[“Documents”,“Warranty”,“Photos”,“Manuals”]

Screenshots: scenario setup, module configuration, errors






Welcome to the Make community!

To do this, you can try using the JSON “Parse JSON” module —

{"array":[
  "item1",
  "item2",
  "item3",
  "item4",
  "item5"
]}

(copy-paste the above into the field, or type it exactly as shown)

For more information about the Parse JSON module and JSON app, see the corresponding Integrations page and the Help Centre documentation.

You can also use the Iterator module—you’ll just have to turn off the “Map” function to be able to insert each item manually.

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew

You can also use these built-in array and string functions:

  • add
    {{ add (array; value1; value2; ...) }}

  • split
    {{ split (text; separator) }}

These functions may have also been covered in the Make Academy tutorials — refer to the Make Academy Course Overview for more info.

Here’s an example of how you can use these functions:

{{add(emptyarray; "item1"; "item2"; "item3"; "item4"; "item5")}}
(copy-paste the above into the field, or type it exactly as shown)

{{split("item1,item2,item3,item4,item5"; ",")}}
(copy-paste the above into the field, or type it exactly as shown)

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew