none
SharePoint Designer: Can I stop a workflow from running if it ran once?

    Question

  • Is this possible? 

    I have a workflow that it runs everytime I modify an item in the Sharepoint online list. It's based on a condition that says "run this workflow if Column C is not empty and send an email to users ABC".

    I have a 2nd workflow that says "Send an email to these users if Column A is not empty".

    I have noticed that Workflow 1 runs, then Workflow 2 runs...however Workflow 1 runs again. 

    Is there a way to stop Workflow from running again if it ran once? 

    Regards,

    Friday, May 24, 2019 5:49 PM

All replies

  • Hi,

    Did you top the workflow in the Workflow 1? Like the screenshot below.


    I suggest you use one workflow to achieve your requirement, modify the workflow 1 and add the condition " Send an email to these users if Column A is not empty", and delete the Workflow 2.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, May 27, 2019 2:13 AM
    Moderator
  • Yes, i did.

    The issue here is that it will run anyway because the condition is that if column C is not empty then send email. I need this condition does not run after it's initial one.

    Tuesday, May 28, 2019 5:59 PM
  • Hi,

    The workflow like the screenshot below.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, May 29, 2019 7:15 AM
    Moderator
  • Hi ZenunJ,

    You can achieve this by checking Workflow Status inside workflow.

    1. UnCheck "Automatically update workflow Status to the Current Stage Name" option.
    2. In Workflow Read the Workflow Column's Description Text.
    3. Check if the Description = 'Completed', if yes then End the Workflow.
    4. If no then send mail and set Workflow Status ='Completed'

    Once Workflow runs and enters into the Title not empty then it sets the Value to Completed and next time it'll get the value in WFStaus, so it'll not run again.

    for " columns 2 WF needed.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    Thursday, May 30, 2019 2:51 PM
  • Hi,

    Any update?

    If the replies help you, please mark the reply as answer, it will make others who stuck with the similar issue easier to search for valid solutions in this forum.

    Best regards,
    Dennis


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, June 3, 2019 2:11 AM
    Moderator
  • Hi ZenunJ,

    You can achieve this by checking Workflow Status inside workflow.

    1. UnCheck "Automatically update workflow Status to the Current Stage Name" option.
    2. In Workflow Read the Workflow Column's Description Text.
    3. Check if the Description = 'Completed', if yes then End the Workflow.
    4. If no then send mail and set Workflow Status ='Completed'

    Once Workflow runs and enters into the Title not empty then it sets the Value to Completed and next time it'll get the value in WFStaus, so it'll not run again.

    for " columns 2 WF needed.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    The WFStatus variable is of type "String"? 

    Also where it says "Set Workflow Status" to Completed. Is the s tatus referring to the local variable that was created? WFStatus or is that an option? 

    • Edited by ZenunJ Thursday, June 6, 2019 8:14 PM
    Thursday, June 6, 2019 5:21 PM
  • Hi ZenunJ

    It'll set the status of currently running workflow as Completed and will be visible in the column created by workflow in the list. So the idea is to set the workflow status by activity instead of automatically set be workflow as stagename (the 1st step). 

    So the next time if workflow started then it will find Completed as Workflow status and will not send mail.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    Monday, June 10, 2019 7:44 AM
  • Hi ZenunJ

    It'll set the status of currently running workflow as Completed and will be visible in the column created by workflow in the list. So the idea is to set the workflow status by activity instead of automatically set be workflow as stagename (the 1st step). 

    So the next time if workflow started then it will find Completed as Workflow status and will not send mail.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    Interesting enough, the columns for the worfklow do not show the "complete". It only states the last stage name.

    Stage 1 is the only stage for that workflow, so when it completes...it just stays there. Therefore it doesn't show the "Complete" string

    Thursday, June 13, 2019 2:57 PM
  • Hi ZenunJ,

    1. UnCheck "Automatically update workflow Status to the Current Stage Name" option in Workflow setting page. 

    

    Otherwise it'll display the current stage name as workflow status. And also use Set Workflow Status activity as mentioned in my 1st reply.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    Monday, June 17, 2019 9:48 AM
  • Hi ZenunJ,

    1. UnCheck "Automatically update workflow Status to the Current Stage Name" option in Workflow setting page. 

    

    Otherwise it'll display the current stage name as workflow status. And also use Set Workflow Status activity as mentioned in my 1st reply.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    This is my configuration for the workflow and still nothing:

    Still having this issue

    Monday, June 24, 2019 7:34 PM
  • Can you share the workflow screenshot also. I'll check

    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    Tuesday, June 25, 2019 9:09 AM
  • Can you share the workflow screenshot also. I'll check

    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    This is the workflow. it's trying to stop itself from resending emails whenever there is a change after it's initial run.

    The 1st line is only copying the names from a column i have to the a person/group field

    I noticed there is an action called "Set Workflow Status", wouldn't this work as well?

    These are my variables for this workflow: 

    Tuesday, June 25, 2019 3:10 PM
  • Hi,

    It should work, as you have used another column for Status. Now workflow status will not show completed as you do not have activity to set it's value. Are you getting any error or mails are running on every change. I suggest use Log to History to track the workflow progress and debug. 

    Also, in Send mail activity use user column directly instead of using variable as workflow checks for valid user using user Account not Email.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    Tuesday, June 25, 2019 3:59 PM
  • Hi,

    It should work, as you have used another column for Status. Now workflow status will not show completed as you do not have activity to set it's value. Are you getting any error or mails are running on every change. I suggest use Log to History to track the workflow progress and debug. 

    Also, in Send mail activity use user column directly instead of using variable as workflow checks for valid user using user Account not Email.


    Best Regards,
    Brij K
    http://bloggerbrij.blogspot.co.uk/

    There are some items that when are modified, the workflow resends the email after it's initial run.

    Tuesday, June 25, 2019 7:16 PM