Gracefully handling whitespace in attachment files

My stack: Softr, Airtable, Make.
I have an image file that comes in via form submission and is then referenced by url.

If the user uploads myimage.png, it’s fine
If they upload my image.png, I get a bundle validation error:

BundleValidationError

Validation failed for 1 parameter(s).

  • Array of objects expected in parameter ‘fldakO3epMtBy732D’.

ChatGPT has sent me down so many rabbit holes but nothing I’ve tried has worked.

I’m not sure if the input box is modal but this is one solution from ChatGPT that isn’t working

I’ve been through the Foundation series and most of the Basics training, but please don’t assume too much about what I know.

Thank you in advance!

Welcome to the Make community!

What you are doing is inserting a JSON string into the field.

That field requires an array of collections.
To create an array of collections, you first need to iterate your array.

For more information, see below.

“Looping” Through Array Items

When you see an ARRAY, think ITERATOR module.

Then,

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Mapping a Specific Structure Into a Complex Field

The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

This is done using the “Target structure type” field in an Array Aggregator module.

Here is an example:

As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.

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.

Thanks so much. In going through training, aggregators is precisely where I left off.

Before getting into the data type issues: are you saying that “my image.png” isn’t an issue I need to deal with? Does Make handle attachment filename whitespace gracefully?

Back to your point. Let me see if I can recap it correctly:
The upload widget in Softr goes to an Attachments field type, which is an array as you can upload multiple attachments.

So when I am trying to map it in Make, using the structured editor (not sure if that’s the right name), and pick 1.thumbnails, I’m feeding it a string instead of an array. (Aside from what was in my OP, i’ve tried putting so many different things in that box.)

So, what you’re saying is, I have to transform the URL string into an array for my Scenario to work?

I need to use an iterator module.
Doing something like this won’t work
[{ “url”: 1.Thumbnails }]

Is that a solid recap?

Thank you so much!

p.s. i uploaded 2 images and everything worked. But users may want to upload 0 or 1 as much as they might do more.