Multiple Run If's not working. Only the first one


Badge +3

I have a form with three status. (Closed, Rejected, and Canceled).  I want a separate e-mail for each status.  I'm using the Run If for each status in the workflow.  Closed status is in the first Run If, followed by Rejected, then Canceled in the remaining two Run If's. Only the Run If in the first position (Closed) is operation correctly.  Rejected and Canceled do not fire and the workflow ends without sending the applicable e-mail.  Is there something else I need to add/configure for a workflow having multiple Run If's and looking at the same field?  Thank you!

198205_pastedImage_1.png


18 replies

Badge +16

can you share your configuration of the run if actions?

I have also converted this to a question for you.

Userlevel 5
Badge +12

Can you use a "Log to History" action to log out the variable you are comparing in the RUN IF to make sure in fact that it is the value you are expecting it to be?  Log it out before you enter your first Run IF.  Configuration screen shots would also be helpful as mentioned above.

Thanks,
Mike 

Userlevel 4
Badge +12

For further advice we need more information from your actions configuration as Cassy and Mike already said.

Besides of this, also think about making your workflow a bit more compact. Instead of doing basically the same three times in a row, your constellation could be a switch:

198221_pastedImage_2.png

This structure will help users to follow your workflow better and makes it easier to maintain.

Badge +16

Just note with the switch that the comparison is case-sensitive so if the status is "closed" no match would be found and the entire switch action and contents would be missing.  I would always add the "other" branch with a switch for de-bugging/error catching purposes

Badge +3

Here is the configuration for the Run If:

198202_pastedImage_1.png

Userlevel 4
Badge +12

Hi Felica,

seems not very complicated to me so it should work. Did you try to log the value of Status of Request to the workflow history as Mike suggested?

Kind regards,

Enrico

Badge +6

Hey Felicia,

are there any actions before the "Run if" actions?

Best regards,

Jan

Userlevel 4
Badge +7

Can we see the configuration of the first run if just to check?

Badge +3

The only thing before the Run If is a Send notification to the requestor informing we've received their request. 

Badge +3

First Run If:

198311_pastedImage_1.png

Badge +16

OK i think your run if actions are configured correctly.

Please try the following - just before the first run if use a log in history list action to output the "Status of Request".  Run the workflow and see the workflow history to see what is logged.  This should also show you in the workflow history which run if action was fired - see if any of the contents of the run if are green (indicating they have been executed).

So just to clarify, on an item with the status of "Closed" does the workflow send an email.  If an item has status of "Rejected" or "Cancelled" the emails are not sent?

Badge +3

None of the e-mails are being sent.

Badge +16

Are you able to create a workflow that just has send notification in (to yourself) just so you can check emails are being sent x

Userlevel 5
Badge +12

As I suggested above, please log out your variable you are comparing in the Run If.   Sometimes the value is not what you might think it is (you might think it holds Rejected for example, but it turns out its empty)... Let us know.

Userlevel 7
Badge +17

Is it a built-in workflow outcome field? Or your custom? Does this outcome, when viewed on a list, is presented as a link, or as a plain text? I faced a situation, when the outcome, which was a hyperlink, when queried in a workflow was not in fact a simple string, but a kind of a JSON structured value. So to exactly get the outcome I had to parse the JSON. I think this can be what you are struggling with.

As others mentioned - log what you are trying to compare happy.png

Regards,

Tomasz

Userlevel 5
Badge +12

Have you found an answer to your question?

Badge +3

Yes.  We worked with Brendan M.  In our scenario, it was best to create two workflows.  One for the initial status (New)notification and one for the other statuses (Closed, Rejected, Canceled) containing the Run If.  The workflow is firing the applicable e-mails for each status.  Thank you.

Userlevel 3
Badge +9

Just for others learning, the issue was that the status of the form would never be anything other than "New" when the workflow fired because it was being triggered on the creation of the item, and the status was always "New" upon creation.  It was only changed to one of the other values afterwards. So I advised to have one workflow that triggered on the start to send the notification that the form had been received.  And then to have a 2nd workflow that was triggered by the status change of the form, that would run the processes for the various status values (Closed, Rejected, Canceled).  

Reply