Hello everyone
I have been racking my brain with this for days/weeks, I have tried so many tutorials, and guides but nothing seems to work.
I have a form, set up for end user to submit a ticket for help (help desk IT ticket). They have to complete questions, give information, etc. and one of the questions is if they have an image or screenshot to share to upload it to the form (using the upload file option on MS Forms).
Well, this is where I am stuck. I do not care if the upload is attached to the email or just a link to view it. What I am running into issues with is when there is nothing attached, it errors out. I have tried various conditions, and nothing seems to work.
Essentially, what I am trying to do is as follows:
Completed form + attachment = emails out
Completed form + no attachment = emails out
Any guidance or help would be appreciated... Like I said, I can get everything to work perfectly IF there is an something uploaded, where it errors out is when there is nothing uploaded.
Thank you in advance!
Solved! Go to Solution.
I wrote a step by step walkthrough on exactly this topic The blog article is here:
Emailing File Attachments from Forms with Power Automate – What Me Pa..Panic? (dontpapanic.com)
Hey @h4X6
Please review the video tutorial below-
https://www.youtube.com/watch?v=kNC8q6NzBEc
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
here is an image of my flow so far and where it is failing when there is no upload
And this is the flow when there is an upload
In addition, I am getting 1 email per upload. If there are 3 uploaded files, I get 3 separate emails.
I wrote a step by step walkthrough on exactly this topic The blog article is here:
Emailing File Attachments from Forms with Power Automate – What Me Pa..Panic? (dontpapanic.com)
Thank you for this. Does this almost mean that the flow won't fail is there is nothing uploaded? My issue is primarily she. Someone submits the form and there is nothing uploaded. That's when it fails.
The walkthrough doesn't cover that, but its easy enough to add a condition to check whether there are or aren't attachments uploaded. Just check the length of the array output from the Parse Json. If its not greater than 0 then there are no files.
edit: delete
edit: delete
edit: delete
Edit:
I have it working with multiple uploads now... but still failing when there is nothing uploaded:
For reference the JSON Schema I am using is:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"link": {
"type": "string"
},
"id": {
"type": "string"
},
"type": {},
"size": {
"type": "integer"
},
"referenceId": {
"type": "string"
},
"driveId": {
"type": "string"
},
"status": {
"type": "integer"
},
"uploadSessionUrl": {}
},
"required": [
"name",
"link",
"id",
"type",
"size",
"referenceId",
"driveId",
"status",
"uploadSessionUrl"
]
}
}
At this point obviously something is wrong with the JSON, i just cannot see what...
It only fails on the parse json when there are no uploads to the form, but everything works as expected when there is an uploaded file(s).
Thanks again everyone!
Check the length() of the question used for uploading the file before you do the parse JSON. If its not greater than 0 then there are no files attached. If it is greater than 0 then parse the JSON and do the rest. If its not send the email without the attachments.
Hey
Thank you for the reply. I'm sorry but that confused me. How do I see the length() of the question ?
Are you saying more the condition to be before the parse JSON? I thought of that but it errors out saying the condition needs to be after as it doesn't know where the JSON is
When you get the response details from the form the answers to each question will be available as dynamic content. Use the expression tab to add a length() function and insert the specific question used for the uploads into that function. I'm sure my questions are different but it should look something like this. If there are no uploads in response to that question it will be blank. In my case I didn't have to do any of that because I made the file upload question required. A user couldn't submit the form unless they uploaded a file.
So I need to enter the dynamic content of the question for the upload in the brackets after the length expression?
And then in the 2nd field enter "is greater then" followed by 0 in the 3rd field?
Inside the Length expression. If the length of the response to that question is 0 then there are no files uploaded. Otherwise correct.
Hey mate @h4X6
You an use to check if the there no attachments uploaded with the condition below-
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
And just to confirm. The condition is put after parse JSON, correct? I ask as the flow fails on the parse JSON when there is no uploaded file and not on the condition
The condition is put before the Parse JSON. You use it to see if there are any files that need to be parsed. If the question answer doesn't have any files then as you've seen the Parse won't work.
Just to back up @Pstork1 answer. Here is the screenshot..
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
edit: im an idiot, and had the parse JSON there 2 times... standby
Edit 2:
So looks like its wokring without the upload now, which is nice
Uploads are not, its erroring out at on the send email portion:
YOu need to have the Send an email in both the yes and No side of the condition. The only difference will be that in the No side you won't load the FileArray variable into attachments, since there are no attachments.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
63 | |
27 | |
22 | |
15 | |
15 |
User | Count |
---|---|
123 | |
46 | |
43 | |
35 | |
31 |