SPD Workflow skipping else-if statements

I'm using an InfoPath form library for this workflow, currently the workflow fires and executes all the steps prior to the one shown below using the else-if statements in those steps (all is good there). However, when the workflow gets to this step it doesn't follow the logic I've setup. As you can see from the first IF, if the recommendation is 1 (approved) then it makes some changes to fields and then waits for the next recommendation to be not empty (this works perfectly if that first recommendation is 1 (approved).

But if that recommendation is 2 (disapproved) it ignores all the else-if statements, doesn't do anything, and stops the workflow. I've tried so many combinations and read all the info I can find regarding else-if statements in SPD but I'm still left with a non-working workflow. If someone can offer some guidance I would greatly appreciate it, thank you.

September 11th, 2015 10:46am

Put in a section that writes the status of the various elements to the history log. It's almost always a logical mismatch ime.

Personally i'd probably put both the CDR recommendation equals 2 blocks in one 'IF' statement and then choose between them in a separate IF loop. It makes it a bit easier to read.

  • Marked as answer by BrandonSG 6 hours 46 minutes ago
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 11:11am

I agree with Alex. Use one If block and one else block for all the conditions.

That eliminates any  if -else mismatch in logic. If you have multiple If-else blocks if one condition satisfies, it jumps to the end. It will not go through the rest of else-if blocks. It moves to next block only if the prior condition fails.

  • Marked as answer by BrandonSG 6 hours 46 minutes ago
September 11th, 2015 11:42am

Put in a section that writes the status of the various elements to the history log. It's almost always a logical mismatch ime.

Personally i'd probably put both the CDR recommendation equals 2 blocks in one 'IF' statement and then choose between them in a separate IF loop. It makes it a bit easier to read.

  • Marked as answer by BrandonSG Saturday, September 12, 2015 12:50 AM
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 3:10pm

I agree with Alex. Use one If block and one else block for all the conditions.

That eliminates any  if -else mismatch in logic. If you have multiple If-else blocks if one condition satisfies, it jumps to the end. It will not go through the rest of else-if blocks. It moves to next block only if the prior condition fails.

  • Marked as answer by BrandonSG Saturday, September 12, 2015 12:50 AM
September 11th, 2015 3:42pm

So I appreciate the help on this, I marked both responses as answers since they both led me to the solution. So SPD didn't like any else-if statements; if I put any of those in, even just one, it would be completely ignored. Makes you wonder why it exists in SPD. What does work, is what the responses mentioned: I only used one if and one else per level. The images below are what worked for me in case it'll help someone else in a similar situation. Thanks for the help

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 9:04pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics