using run if on site workflow

  • 21 March 2016
  • 9 replies
  • 3 views

Badge +8

Good day,

I am trying to use a run if on a site workflow and it doesn't seem to be working, it isn't failing, just not doing what it is supposed to do. The options are a little different then list workflows; basically I am not sure what the bottom [highlighted in red] is supposed to be used for.  What I want it to say is "if PermissionsWFRun = 0, then run the workflow."

Thanks,

Jennifer


9 replies

Badge +4

Jennifer,

When you are using a Site Workflow and a List Lookup, you will need to help the workflow find the specific Item in the list that you want to run the workflow for, and then check the value for PermissionsWFRun field.

Will you have multiple items in the list with  PermissionsWFRun = 0? I will assume Yes. (if no, please see at the end of this post)

In that case, you need to precede the RUN IF Action with a Query List action and a For Each. Something like below:

180472_pastedImage_4.png

180471_pastedImage_3.png

You could also filter out the results of Query List action and avoid using the RunIf action.

If you will NOT have multiple items in the list with  PermissionsWFRun = 0, then you could do Query list as below, and then skip the For Each and the Run If actions.

180476_pastedImage_6.png

Userlevel 7
Badge +17

You could change the condition dropdown to "If current item field equals value", set the field to PermissionsWFRun, then type 0.

In the screen shot, you are asking, If any item found in the list ContractRouting where PermissionsWFRun is equal to 0, then take the collection of that result and compare the entire collection to the value of not 0. This condition should never be found in it's current state.

Badge +8

Sorry I should have been more clear and shown the entire workflow.  I do have a query list action; the part that I am confused on is the red part of the Run If. 

Thanks,

Jennifer

Badge +8

Thanks for the reply Andrew; where would I do that? I have that selected at the top [red] and it isn't an option at the bottom [yellow]:

Thanks,

Jennifer

Badge +4

Jennifer,

Here is what I think you need to change. From what I can see, you are getting into a circular reference. You need to compare the variable you are getting out of the "For Each" action, to the column in the list to narrow down to a specific item,. and then lookup the value for PermissionsWFrun, and it it is 0, then execute the RUNIF.

180498_pastedImage_0.png

Userlevel 7
Badge +17

The top in Red seems to say "If Any value equals value". I don't see that it is selected as "If current item field equals value"

Badge +11

Because she is running a site workflow. No "current item" available here.

Userlevel 7
Badge +17

Good point, missed that detail

Badge +8

Thanks Prasanna​ that was really helpful!

Reply