@pbj2011 The logic of your flow needs a little adjusting. What you'll need to do is the following:
- Get the Form Response details
- Collect all file uploads into a collection
- Create a SP Item
- Check to see if any files have been uploaded – If a user must upload at least one file you can omit this step
- Loop through all uploaded files
- Add attachments to the SP Item
- Collect attachments into an array variable
- Send an email

I'm only going to cover how to get the file uploads from your MS Form into SharePoint and attached to an email. If you need additional help on formatting your email or MS form responses— refer to this YT Tutorial I recently uploaded: How to Get a Microsoft Form RSVP Response into a SharePoint List
I cover the following in this video tutorial:
✅ How to get a Microsoft Form Response into SharePoint
✅ How to get a Microsoft Form ID
✅ How to get a Microsoft Form response
✅ How to Build a Microsoft Form with Conditional Fields
✅ How to used Branching in Microsoft Forms
✅ How to format Microsoft Form multiple choice responses for a SharePoint multi-choice column
✅ How to parse a Microsoft Form multiple choice response as string of text
✅ How to convert a text response to a number
✅ How to use the Switch action
✅ How to create a custom email confirmation for a Microsoft Form submission
✅ How to Create a Custom View in a SharePoint list
✅ How to use the Compose Action
✅ How to write Power Automate Expressions
Manual Trigger
In the tutorial I cover how to use a manual trigger so that you don't need to submit a form each time to trigger your flow. Please reference this section of the tutorial on how to do this.

Compose File Uploads
I'm using a Scope action to group the next few actions in the flow. Scope actions are great because they help keep my flow organized. I can also quickly collapse multiple actions with a single click. The Scope action is optional.
Add a Compose action for each File Upload field in your form. For my demo I have 3 file upload fields.

Insert the json() expression. This function will convert the file upload details into a readable format—a JSON array.

Click on the Dynamic content tab and insert the appropriate MS Form output.

Repeat this step for each of the file upload fields in your form. Tip: Remember to rename your actions to keep your flow organized.

Combine File Uploads
Next you'll need to combine the file upload JSON arrays into a single array. Add a Compose action. I've nested mine inside another Scope action (the Scope action is optional).

To combine arrays into a single array. You'll need an expression. First you'll need an expression to check if the array is empty. If it is, you'll need to output an empty array instead of a null value. You'll be using the union() function to combine the arrays and this function requires arrays. If you try to pass a null value you'll get an error.
To check if the array is empty, we'll need to use the empty() function.

Click on the Dynamic content tab and insert the output from the Compose action that is storing the response from the first file upload field. Note: This is why it's important to rename your actions. Otherwise things can get confusing really fast.

Next, we'll need to use the if() function.The if() function takes three parameters. The first parameter is a condition that returns a boolan value (aka true or false), the second parameter is the value that is returned if the condition is true. The last parameter is the value returned if the condition is false.
Go to the start of the expression by pressing the up arrow key and type in if with an opening parenthesis. Keep an eye out for the expression tooltip. It'll bold the text of the parameter you are currently setting.

Go to the end of the expression by pressing the down arrow key and enter a comma and insert:
json('[]')
This is the true value. In other words, if your array from the first file upload field is empty, it'll output an empty json array.
Add another comma and insert the output from the first file upload field again.

Add a closing parenthesis.

Your expression should look like this:
if(empty(outputs('Compose_-_Upload_Files_1')),json('[]'),outputs('Compose_-_Upload_Files_1'))Keep in mind, if you've named your Compose actions differently than what i have in my flow, your expression will look slightly different.
Run a test. If your first file upload field does contain file uploads, you should see the details of those files in the outputs.

If your field doesn't contain any file uploads the Compose action will look like this:

If you click on the Click to download link—you'll see an empty array. This is what you want.

Because you have many file upload fields. It'll be a lot easier to compose your expression in a text editor. The expression editor in Power Automate makes it really hard to see the full expression.
Click on the expression label to open it up in the Expression field.

Copy the entire expression to your clipboard.

Paste it into a text editor. Add a comma at the end of the line.

Paste in as many lines as you need, ensuring that you add a comma after each line (except for the last line). In my case, I only have three file upload fields. You'll need to adjust the numbers for each line—this will only work if your Compose actions have the same syntax.


Next, wrap the entire expression in the union() function. The union() function will combine two or more arrays or collections into one and remove any duplicates in the process. In your scenario you don't need to worry about any duplicates as you are really using this function just to combine the arrays.

Copy this entire expression to your clipboard. Replace the existing expression with your new expression.

Return the File Count
Use an expression to return the count of items from the Compose action above. This is can be helpful to troubleshoot.
Insert a Compose action. Add an Expression. Use the length() function.

Select the Dynamic content tab and insert the value dynamic content from the Get Items action into the length() function.

Run a test. Confirm the number in the Compose action output.

Create Item
Add a Create Item action and insert any dynamic content where necessary.

Initialize Array Variable
Add an initialize variable action to your flow. Select Array as the type.

Condition Check
Add a Condition action to your flow. In the first value field, insert the output from the Compose action that is storing the count of files.

Change the operator to is not equal to and enter zero into the second value field.

In the YES branch add the rest of your actions.
Loop through Each Attachment
Add an Apply to Each action into the YES branch. Insert the output from the Compose action with the array of files.

Get File Content
Add a Get file content using path action. You'll need this action to get each attachment's file content so that you can attach it the file to a SP item as well as an email.

In the File Path field, you'll need to use an expression to access the file path.
If you take a look at the output of the Compose action that combines the file arrays, you'll see the dynamic content. The expression we'll be using is the item() function. To access the dynamic content you'll need the dynamic content key. The dynamic content key is the text in red between the double quotes.

In this case, it's link.
Insert an expression:

Because you'll need the attachment name in the next couple actions, I'd recommend using a Compose action to store it. You'll use the same expression as above, you just need to adjust the dynamic content key from link to name.

Add Attachment to SP Item
Add an Add attachment action to your flow. Ensure it's nested inside the Apply to Each action.

For the ID, you'll need to insert the ID from the Create Item action.

For the File Name, you can insert the output from the Compose action above.

For the File Content, insert the File Content dynamic content from the Get file content using path action.

Run a test. Check to see if your SP item has been created with attachments.

Append to Array Variable
Add an Append to Array Variable action. Insert the following JSON.
{
"Name": [Insert Compose Action Output],
"ContentBytes": [Insert File Content]
}
Send an Email
Add a Send an Email (V2) action outside of the Apply to each action.

Click on Show advanced options. Click on the icon to switch to input entire array.

Insert the variable into the Attachments field.

Run a test. Ensure that the email has all of your attachments.

Hope this helps!
If I helped you solve your problem—please mark my post as a solution ✅. Consider giving me a 👍 if you liked my response!
|
If you are looking for a way to send multiple SharePoint List items that have been assigned to a user in an email—check out this YT Tutorial: How to Send a SINGLE EMAIL ✉️ with multiple SharePoint list items | Build THIS Power Automate Flow
In this tutorial I cover:
✅ How to send multiple list items in a single email with a Power Automate Flow
✅ How to create a dynamic date range
✅ How to use the Convert Time Zone action
✅ How to use a Filter Query in the Get Items action
✅ How to count number of items in an array
✅ How to use the Select action to extract a users display name and email address
✅ How to create a unique list of email addresses
✅ How to use the Create HTML Table action
✅ How to customize the HTML Table with CSS styles
✅ How to use the Send an email (V2) action
✅ How to use the Append to String Variable action
✅ How to create a custom list of items for an email
✅ How to use the Send an email (V2) action
✅ How to display singular or plural text based on the number of items returned