Dynamic object name

I have webhook data coming from emails. However, if there are multiple attachments, they appear as objects like attachment1 , attachment2 , etc. I know how many attachments to expect (because of attachments variable), but I’m struggling with the get method to dynamically retrieve all the attachments and its values / params / properties. Anynone who did it?

1 Like

Welcome to the Make community!

You can use the built-in functions add and remove in a Set Variable module:

e.g.:

{{ remove(add(emptyarray; 17.attachment1; 17.attachment2; 17.attachment3; 17.attachment4; 17.attachment5); null) }}

Screenshot_2025-02-22_160242

This is just an example. You can extend it past five if you are expecting more than five.

For more information, see the function documentation in the Help Center and do the tutorials in the Make Academy.

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.

1 Like

Thank you samliew, not totally as I would love to have it done since it is not as dynamic as I expect, but as a hotfix nice soultion :slight_smile:

There’s a way to make it dynamic, but it is advanced and costs more operations.

ohh, teach me that please, or at least show me the way :slight_smile: