I am trying to create a flow which people submit a form and can (but not always) include an attachment and get it to send an email then create a task and include attachment if applicable.
This is my flow currently after trying to follow multiple pages and guides:
How to use Upload File from Microsoft Forms in Power Automate - Fabozzi's Compiled Knowledge
Microsoft Forms now supports attachment uploads! – Loryan Strant, Microsoft 365 MVP
Working with Files on MS Forms in MS Power Automate (bythedevs.com)
I have labelled each picture with expressions under all the pictures.
1
2
3
4
1 - json(body('Get_response_details')?['rdb8aa8697f304ceb80cf19241d4ac1c7'])
2 -
Solved! Go to Solution.
Hi @RBS1995 ,
Do you want:
1. After the user submits the form, create the file submitted by the user in SharePoint
2. Email the file as an attachment
3. According to the information in the form, create a Task and update the details
4. Delete files in OneDrive.
Here is test for your reference:
Here is form:
Here is flow:
Here is link for your reference:
Re: Multiple attachments in Form with branching fl... - Power Platform Community (microsoft.com)
Best Regards
Cheng Feng
Hi @RBS1995 ,
You can add a branch,
when the user does not upload a file,
[Apply to each] will fail, when it fails, execute the flow of this branch.
If this post helps, then please consider Accept it as the solution to help the other members find it.
Best Regards
Cheng Feng
Hi @RBS1995 ,
Do you want:
1. After the user submits the form, create the file submitted by the user in SharePoint
2. Email the file as an attachment
3. According to the information in the form, create a Task and update the details
4. Delete files in OneDrive.
Here is test for your reference:
Here is form:
Here is flow:
Here is link for your reference:
Re: Multiple attachments in Form with branching fl... - Power Platform Community (microsoft.com)
Best Regards
Cheng Feng
Hi Cheng,
Thanks for this.
I have followed this, and it seem to be failing on the Apply to Each step:
Thanks
Reece
Hi Cheng,
Can you post the JSON parameter please?
Thanks
Reece
Hi @RBS1995 ,
Do you upload files while testing?
What is put in json() is:
Best Regards
Cheng Feng
Hi @v-chengfen-msft ,
Yes I have included and attachment this time around but also wanting to make it so if people dont attach a file, it wont fail.
Also I was meaning the JSON parameter in the append array variable - sorry.
Thanks
Reece
Hi @RBS1995 ,
Here is JSON parameter:
I used a compose to show this:
Could you show your flow and do a test again, and take a screenshot of the place where the error is reported?
Best Regards
Cheng Feng
It is this one I am needing.
I's not sure how to enter the same format as what you provided previously.
Apologies for the ignorance, I am still getting to grips with PA.
Thanks
Reece
HI @RBS1995 ,
Please try :
{
"Name": @{items('Apply_to_each')?['name']},
"ContentBytes": @{body('Get_file_content')}
}
Best Regards
Cheng Feng
I have added this and ran it and the test ran first time!
However, it is showing this on the email:
Is this how it should show?
It does have the attachment on the email also
Thanks
Reece
I have applied this, and it works great!
I have submitted a form without an attachment also and it failed.
Is there a way to make it work if users don't attach a file onto the form?
Thanks
Reece
Hi @RBS1995 ,
You can add a branch,
when the user does not upload a file,
[Apply to each] will fail, when it fails, execute the flow of this branch.
If this post helps, then please consider Accept it as the solution to help the other members find it.
Best Regards
Cheng Feng
User | Count |
---|---|
88 | |
39 | |
23 | |
20 | |
16 |
User | Count |
---|---|
127 | |
49 | |
46 | |
31 | |
25 |