cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gaia
Regular Visitor

Trouble Sending Email After Document Approval

Hello,

 

My flow is as follows:

1. For a Selected File

2. Start an Wait for an Approval - Approve/Reject (Everyone must approve)

3. Condition- Outcome contains Reject

3.1. If Yes:

3.1.1. Update file properties

3.1.2. Apply to each: Outlook Send Email (V2) - to the user created the approval request, notifying of rejection.

3.2. If No:

3.2.1. Update file properties

3.2.2. Outlook Send Email (V2) - to the user created the approval request, notifying of approval.

 

I get the following error:

Flow save failed with code "InvalidTemplate" and message "The template validation failed: 'The inputs of template action "Send_an_email_(V2)" at line '1 and column '4690' cannot reference action "Update_file_properties". Action "Update_file_properties" must either be in "runAfter" path or within a scope action on the "runAfter" path of action "Send_an_email_(V2)", or be a Trigger.'.'
 
It's worth mentioning that without step 3.2.2, the flow works fine.
 
Thanks for the help!  

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hello @Gaia ,

you can use only outputs from actions that are in the same branch of the flow (red arrows), but you're using cross reference (orange arrows) in the 'Send an email (V2)' action. You can't do that, 'Send an email (V2)' can use only outputs from 'Update file properties 2'.

image.png

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

You can use dynamic content, but it must be in the same flow path. When the flow triggers, it'll go through some path, only through some of the actions. You can use only the dynamic content that's available in that path.

When it'll reach the condition, it'll decide if it'll go through the left path or the right path, and skip the other one.

If it goes through the If yes path, you can use only dynamic contents from the left path (+ all actions that lead to the left path). If it goes through the If no path, you can use only dynamic contents from the right path (+ all actions that lead to the right path).



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

6 REPLIES 6
tom_riha
Super User II
Super User II

Hello @Gaia ,

you're referencing wrong 'Update file properties' in the 'Send Email' action. Each 'Send email' can reference only the 'Update file properties' that's in its condition branch, you're probably referencing the other one in one of the notifications. Try to remove all dynamic contents in the emails and add them again.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Gaia
Regular Visitor

Hi @tom_riha, I'm not sure I understand what you mean.

I'm attaching a screenshot of the Yes/No flow. 

As I mentioned the Yes side works perfectly if delete the Send an Email from the No branch.

Screenshot 2021-07-13 111619.png

Hello @Gaia ,

you can use only outputs from actions that are in the same branch of the flow (red arrows), but you're using cross reference (orange arrows) in the 'Send an email (V2)' action. You can't do that, 'Send an email (V2)' can use only outputs from 'Update file properties 2'.

image.png

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Gaia
Regular Visitor

Thanks @tom_riha, I understand now.

But that would meant there's no way of notifying the user via mail that their document has been approved/rejected? If I can't use dynamic content....

You can use dynamic content, but it must be in the same flow path. When the flow triggers, it'll go through some path, only through some of the actions. You can use only the dynamic content that's available in that path.

When it'll reach the condition, it'll decide if it'll go through the left path or the right path, and skip the other one.

If it goes through the If yes path, you can use only dynamic contents from the left path (+ all actions that lead to the left path). If it goes through the If no path, you can use only dynamic contents from the right path (+ all actions that lead to the right path).



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Gaia
Regular Visitor

OK @tom_riha, now I understand and managed to make it work.

 

Thank you!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,006)