New Employee workflow

Copper Contributor

Hello,

New to power workflow. I am trying to make it easy to set up a new user starting at  HR send an email to the manager to add a user profile, and after the manager adds their info send an email to IT to create an account for the new user. Once IT has finished creating the account an email is sent back to HR  and the manager that the new employee's account is ready.

I have the flow but having issues with too many repeated emails. Here is my flow

 

mlott1785_0-1657640389359.pngmlott1785_1-1657640530051.png

This part is when HR adds the first and last name and yes to complete an email is sent over to the manager.

mlott1785_2-1657640590756.png

 

mlott1785_3-1657640722985.png

mlott1785_4-1657640951682.pngmlott1785_5-1657640992374.pngmlott1785_6-1657641030041.png

My problem is after the yes that triggers an email to the manager that goes through without a problem. The second condition is when the manager completes their part an email is sent to the IT department, but an email is sent to the HR and the Manger, and then the email is resent to the IT department. which this should not be. How can I just have an email sent to Manager and then the IT department and not resend the past emails again?

9 Replies

@mlott1785 you're getting multiple email because the flow triggers every time the SharePoint item is modified, which column that might be. Make sure you turn on versioning in your list settings. Then your trigger should be when an item or a file is modified. Then you have the get changes action but instead of Trigger Window in the Since and Until fields use an expression of 

sub(int(triggerOutputs()?['body/{VersionNumber}']),1)

 

in the Since field only. That will check the current version of the item against the previous version. Then have a condition of Has column changed: xyz. If it has then do an action. If it hasn't then do nothing or do another action.

 

That way you can prevent your flow triggering every time the list item is modified and only have it trigger when the column you want is modified.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

I appreciate the info, Being new how do I add the sub(int(triggerOutputs()?['body/{VersionNumber}']),1) line?

@RobElliott 

@mlott1785 click in the field and the dynamic content box will open click the Expression tab and paste it into the box.4-Flow-Changed.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Okay I added the expression and when I run it the first time In the test I get this error
"Specified Version Label does not correspond to any actual version
clientRequestId: 6485004e-6169-48f6-93cb-9bb5540650aa
serviceRequestId: 6485004e-6169-48f6-93cb-9bb5540650aa"
But when I make a change and run it again no error version is changed to 2. Another thing I notice it still sends out all three emails. instead of the conditions, I told it to trigger.
Did you turn on versioning on the list?
Yes I have.
I can't second-guess what's happening, you need to add screenshots of your current flow.

@RobElliott 

When I run the flow in the test I get the flow failed

 

mlott1785_0-1657746975133.pngmlott1785_1-1657747014715.png

But when I run it a second time it is okay.

@RobElliott 

 I meant to say the error does not show when I run it again. When my second condition is completed I still receive the first Email and the second.

Here is my second condition.

 

mlott1785_1-1658965989476.png

The manager finished and the condition was only yes. Send an email to the administrator.