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."
Solved! Go to Solution.
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:
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.
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.
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.
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.