- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 05:36 PM
In Flow Designer, I'm working on a flow which has a Wait for Condition action based on a variable on a Service Catalog item. The variable is multiple choice with two possible values: yes and no. The variable does not show in the portal view of the form; it only appears in the back end after the request has been submitted. The variable is set by the fulfiller/agent (person in the group the ticket is assigned to), so I can't base IF flow logic on the variable's value until it's been set to yes or no.
I'm using a Service Catalog trigger and have a Get Catalog Variables action before the Wait for Condition action. Using the Condition Builder, there is no 'is not empty' option for the variable so I set the operator to 'is one of' and the values to yes and no. I suspect this is where the problem lies. Is there a way to use the Condition Builder to check for empty/null values for a multiple choice variable?
When I test the flow on a RITM where the variable has no value yet, the flow stops in Test Run - Waiting status with no errors. When I update the variable's value, nothing happens. If I run the test after the variable is set, it does what it's supposed to do, based on the variable's value. I've also tried activating the flow (I'm working in dev) and nothing happens after I update the variable.
Solved! Go to Solution.
- Labels:
-
flow designer
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2024 11:23 PM - edited 06-08-2024 11:24 PM
Hi @sbh,
I tested something similar in my PDI and it seems to be working fine, the Flow is paused until the variable is updated.
Can you do the following:
- Set the Duration of the Wait for Condition to 0.
- It does take a few minutes for the Flow to progress after the update is made. Did you make sure you waited for at least 5 minutes?
- Make sure the correct variable is selected in the Wait for Condition action
If the above does not fix the issue, try cross-checking with my configurations:
- Multiple choice variable created with 2 options (Yes, no) and none
- Flow configured as the following:
Hope that helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 12:55 PM
Hi @sbh ,
I have faced issues with Wait for Condition based on variables. I would suggest updating a field on the RITM instead of a variable and set the Wait for condition on the field. I would not recommend creating a custom field however, I have managed to use the stage field for this purpose. You can use any other if it suits you.
For example, create a new stage and add it on the Flow. Update the Wait for condition to "Stage changes to 'newValue'". Add a client script(i don't really recall if it was a client script i used, feel free to try other options) to update the stage field to the new value, onchange of the variable on the RITM. The flow should move forward as soon as the stage value is changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 04:22 PM
I see what you mean about waiting five minutes. I activated the flow (in dev), waited a bit, then set the variable to Yes. About five minutes after the update, the stage changed. Then when it went through the two steps after the Wait for Condition, it correctly evaluated the If = no as false, and incorrectly evaluated the If = yes as false, and stopped. But when I tested the flow against the same RITM, which already had the variable set to yes, it correctly evaluated both If steps and when on to do the steps under the If = yes.
So now it's waiting for the condition to change on actual RITMs submitted in dev - but not when I run a test in Flow Designer against a RITM where the variable hasn't been set yet. And it's evaluating correctly when I run a test in Flow Designer against a RITM where the variable has been set - but not after completing a Wait for Condition on actual RITMs submitted in dev.
So I'll mark your post as the solution with many thanks, @James Chun ! Including none on the multiple choice variable does enable evaluation of the condition.
And then I'll post another question about the flow running differently during a test in Flow Designer than it does against RITMs submitted in dev.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:49 PM - edited 06-11-2024 03:57 PM
The critical part for me was "Multiple choice variable created with 2 options (Yes, no) and none"
Thank you, @James Chun !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 12:55 PM
Hi @sbh ,
I have faced issues with Wait for Condition based on variables. I would suggest updating a field on the RITM instead of a variable and set the Wait for condition on the field. I would not recommend creating a custom field however, I have managed to use the stage field for this purpose. You can use any other if it suits you.
For example, create a new stage and add it on the Flow. Update the Wait for condition to "Stage changes to 'newValue'". Add a client script(i don't really recall if it was a client script i used, feel free to try other options) to update the stage field to the new value, onchange of the variable on the RITM. The flow should move forward as soon as the stage value is changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 03:56 PM
Thank you, @yadavrekha ! This is the one that worked for me.
- Rather than a client script, I used a after-update business rule based on sc_req_item that's triggered when the variable's value changes. I checked 'advanced' and changed the stage based on the variable's value.
- I changed the Wait for Condition to wait for the RITM's stage to change to whatever the business rule set.
And you're right, there's no five-minute delay with this method. Thank you!