Forum Discussion
New Employee workflow
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
This part is when HR adds the first and last name and yes to complete an email is sent over to the manager.
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?
- RobElliottSilver Contributor
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- mlott1785Copper Contributor
I appreciate the info, Being new how do I add the sub(int(triggerOutputs()?['body/{VersionNumber}']),1) line?
- RobElliottSilver Contributor
mlott1785 click in the field and the dynamic content box will open click the Expression tab and paste it into the box.
Rob
Los Gallardos
Microsoft Power Automate Community Super User