I have multiple arrays from file upload dialogs in Jotforms, and merge these together in Make. Before the merge, I need to add a new field to each array to identify the name of the file upload dialog it came from. Example array is below
Doc Name: XXXX.jpeg
Upload Date: 31/07/24
I need to add a new field called “Type” to this array so the new array will look like the below:
Doc Name: XXXX.jpeg
Upload Date: 31/07/24
Type: Supporting Information Upload Dialog
Would appreciate if someone can shed some light on how to do this in Make please.
So what you need to do is after you create your array with the doc name and upload date create a variable that will set your type. After that you then want to use an array aggregator and select doc name, upload date and type.
Thanks - this does work. However, I have 15 upload dialogs, which means 15 arrays, so it would mean a lot of additional modules. Is there no way this can be done with functions/code?
Sure you can do something like this. Create a new array selecting the type and your two other values needed. The keys won’t be defined anymore but they will always remain the same unless you change them. What do I mean by this if you set the second value as id like I did it will always be id but the key won’t say id. Let me know if this helps.
In principle this should work however the new array is only outputting 1 bundle, but the original array from the file upload dialog has 2 bundles. Any ideas?
So I think I am being daft and not explaining myself/getting confused.
So the array has multiple collections in it, and I want to add the new type field to each collection in the array. Each collection can then have a different “type”
Hopefully this helps explain a little better. So you can see the file array, with multiple files as collections. I need to add a new field to each collection as shown in the image “Type” = the new field.
I see and I agree - however, there’s lots of separate arrays, around 35 so it would mean a lot of modules and operations which I don’t think is feesable.
Why would it be alot of modules? Operations are relative my org using 2 mil a month so using 200 is peanuts. It would only take 3 modules. Iterator on file array, set variable for type you can use switch function here to set your type, aggregator bring everything back together.
There’s 35 arrays, with multiple collections within each array.
I need to add a new field called type to each collection as they are all different.
Once the type field has been added and given a value , all the arrays will be merged into a single array as they will end up in the same table in a database, so processed in the same branch that adds it to the database, hence merging.
So with the above, I don’t think one set of modules is going to work.