Forum Discussion

bryanfrumkin47's avatar
bryanfrumkin47
Copper Contributor
Oct 03, 2023

User to not be notified unless they are assigned an item

Thank you so much for all help and assistance as I am unable to create a part of the solution to my issue.


My goal: Ensuring that a user is not notified unless they are assigned an item at least 15 minutes from the last time the flow was executed with them being the assignee
 
Setup: Currently, I have a flow that's triggered when an item is changed in a SharePoint list.
It gets the changed item and checks if the "PMAssigned" column has changed.
If it has, it stops editing permissions for that item and grants access to the user assigned to the lead. If the time elapsed since the last notification is greater than 15 minutes and the user assigned to the lead has changed, it sends an email to the new user. 
The condition is slightly incorrect because it checks to see if the user assigned to the lead has changed since last time, but rather it needs to check if that user in the last 15 minutes, has had the flow executed with them being the assignee.


Please let me know if you have any questions or concerns.

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    Hi bryanfrumkin47,


    I understand that you want to make sure that your users should not be notified twice within 15 minutes if an item has been assigned to them.

    In that case you could create a new column "MessageSentDate" and set that to the current utcNow() whenever your Workflow has sent a message to a user.
    Then query the SharePoint list for all items where the  the current user is the assignee and where that date is less than the current date minus 15 minutes. If that returns an element, then do not sent an email

     

    PMAssigned/EMail eq '@{triggerOutputs()?['body/Editor/Email']}' and MessageSentDate le datetime'@{addMinutes(utcNow(),-15)}'

     

    length(outputs('Get_items')?['body/value'])


    Best Regards,
    Sven

    • bryanfrumkin47's avatar
      bryanfrumkin47
      Copper Contributor

      Hello SvenSieverding!
      I was able to implement your helpful advice, but if the assignee has not been assigned an item in the last 15 minutes it will still not send an email with the current condition.
      Moreover, currently no emails are sending.

      I am unable to find a solution without moving toward a different solution entirely. 


      All help is truly appreciated.

Resources