Hi,
Here's some framework to help you work with attachments from a Form. In my example, I am getting them and sending them as an attachment by email.
Sample Form:
The trigger and get response details are self-explanatory. Next create an array variable 'attachments1'
Next in my example, the file upload question is optional. So here I check if the question was submitted in a condition.
Next I will use Parse JSON. Here I am using the json from the output of the get response details for the individual question. A lot of people ask where to get this while building though. What I typically do when working with Form attachments is after the trigger and get response details, SAVE and submit a test run. Now you will have a JSON payload to work with when you get to this step.
Ok, so I submitted a test Form after adding the trigger and get response details. Look at the output and copy the json for the file upload question. It starts with a [ and ends with a ].
You will use the example to build your schema below.
So here, I am pointing to the question that contains the file upload in the content field. Now, with the JSON output from the specific question copied, click on 'Use sample payload to generate schema', shown above. Paste in your example. That's going to give you something like this above.
The next step is to add Get file content action (do not add apply to each manually), it will automatically be added for you.
When you add the dynamic content Body ID in the File field, it will automatically wrap itself in an apply to each, because your file upload question may allow more than one attachment to be uploaded.
Next inside the apply to each, add Append to array variable. shown below.
Last step, outside of the apply to each, add a send email (in this example), and format like this shown below.
So in my example, remember I added two files in my file upload question. Notice below my apply to each has run loops in the output. So each time I run through the loop, using the parse json schema (which exposes the dynamic content for the upload details), I get the file content and append the data to my array.
Regardless of what you end up doing with your attachments, this is a good demo of the parse json and apply to each process and hope this helps!
------------------------------------------------
⭐ If this was helpful, please like and/or mark as a verified answer to help others find this too!
Always glad to help! 💯💯💯💯💯
Tom
Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn