I would like to trigger a branch by using a variable and 1 “Is Match” per Pick Branch. “Is Match” outputs a Boolean result, so I thought it would work.
It does not. It always goes with the left-most branch.
The documentation is very limited so I would like to know what I can use to trigger the branches?
How to use?
—>
See, Pick activity contains a collection of PickBranch activities, where each PickBranch is a pairing between a Triggeractivity and an Action activity.
You can use Element exist, Image exist as a Trigger like this
In your case,
If you’re using “is match” as a trigger, you need to first conform that your “is match” pattern works fine.
And, When using Pick, the branch that executes is the branch whose trigger completes first.
They says, all triggers execute in parallel but yes, I also observed that it’s from left to right.
Then your left-most ‘is match’ always gives boolean=true,
So I’ll suggest you,
recheck Is match’s pattern and it’s output (boolean value) by giving different inputs.
As you can see, the TestVar that is assigned “123456”.
The left-most “Is Match” tries to find “abc” which should be false.
The right-most “Is Match” tries to find “345” which should be true.
However, the left-most branch always executes.
I’m sorry, but I can’t attach the .xaml, but the flow is very simple, as the pictures above shows.
hey @MatsO
Its giving you correct output
I’ll explain…
As I said before
Take one example here, and follow these steps:
Use ImageExist activity as your trigger in both of those branches
Indicate them with two different images (put Expected image in right-most branch for better testing)
In action section put message box accordingly.
and run the program.
It’ll give you correct output (with right-most message box)
Because when you run the workflow, all triggers starts executing in parallel but right-most trigger will complete first (because left-most trigger is still searching for the image).
So in your case both triggers completes their execution at the same time.
1st is getting boolean value as False and 2nd is true (you can check it by putting boolean variable.ToString in their message boxes)
SO, again the main point is whose getting what value is not important here, whose trigger completes first is important, and
because of this your left-most branch executes every time (In your case)
Thank you very much for explaining this to me.
I thought the trigger was something that expected output “true” or “false”.
Instead the “trigger” is only which “trigger-sequence” finishes first.
So the “image exist” works, not because one of them finds the image (output=true), but in reality, it’s the timeout of the other events that delays those branches from triggering.
That was not at all what I expected from a trigger.
Thank you for clearing this up for me. Much appreciated!