I am pretty new to SharePoint and I have created a ticketing system that will generate out an email when a list item has been modified. I am running into a problem regarding attachments in the email.
Originally I created a flow that worked however it did not include any attachments listed on the list item. I created a replacement flow that would pull in the attachments but would only trigger the email if an attachment was included. I made some adjustments to it and now it sends two emails for each list item - one with an attachment and one without it. If there is no attachment then it sends the same email with no attachment listed twice.
What I am wanting is one flow that will send only one email. If there is an attachment to include it, if no attachment is listed, send an email with no attachment. Can someone let me know what I need to correct? Or how to create a new flow if that is what is needed.
Hello,
I have created a flow that sends an email based on the item attachment condition, the flow sends multiple attachments together in one email.
json to append in the array avriable is
{
"Name": @{items('Apply_to_each_2')['DisplayName']},
"ContentBytes": @{body('Get_attachment_content_for_item')['$content']}
}
display name is selected from get attachments 2 action and for contentbytes property @{body('Get_attachment_content_for_item')['$content']} should be written in the expression window. The expression may change based on your action names.
Thanks,
CK
Accept my post as answer if it resolved your question.
Could I see the drop down you have in the "Initialized Variable Attachment Array? I was originally getting an error there. I corrected it and the flow will run but I am still getting two emails.
Its just an array variable, if you are still getting two emails you might want to check if the email action is under a loop.
Yes it appears to have the loop.
The only difference I see between your flow and mine is I have a Switch in place for the status value inbetween the Variable Array and Condition for the attachment = true. The status is the factor that determines if an email needs to be generated.
If you can start the reply case with if condition and move the get attachments action to under the yes branch and above the apply to each loop action and delete the apply to each loop 2 action which is causing multiple emails will resolve the issue. I am not sure if there is reason for you to have get attachments above apply to each 2 loop.
Would you be able to show me an example of the IF condition? I believe I tried a condition and it did not work which is why I changed to a Switch condition. Maybe I have had the formula incorrect???
Hi,
Its a simple condition which checks the has attachments column from item created or modified action
Let me know if you have any questions.
Oh yes, I originally did that and it did not work. That's when I found the switch case and that seemed to fix one issue.
I started working on another test flow today and I have it so that it only sends one email however it does not pull the attachment in. It looks like it is set up the same as yours above just with the switch case in place.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
88 | |
58 | |
42 | |
37 | |
36 |
User | Count |
---|---|
86 | |
72 | |
61 | |
57 | |
40 |