How to make variable mandatory only after approval has been given and task created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2025 02:23 PM - edited ‎05-22-2025 02:24 PM
I have a request on a new catalog item for one of the variables to only be visible at the RITM / SCTASKs level.
- the variable will actually be completed during TASK 1
I am trying to figure out a way for this variable to NOT be mandatory until AFTER the approval has taken place and the catalog task has been created.
Once the 1st catalog task is created, this variable needs to be visible and editable so it can be filled in as part of completion of task one.
Any assistance anyone can offer will be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2025 02:37 PM
Hi @kdelbridge
You can follow the below steps to achieve the requirement
Create the following Catalog UI Policies:
Hide the variable on the catalog item form.
Make the variable visible and read-only at the Requested Item (RITM) level.
Make the variable visible and mandatory at the Catalog Task level.
Add the variable to the Catalog Task - variable list in the associated flow.
Thanks,
Dinesh
Please accept the solution and thumbs up if it is helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 11:22 AM
this is a start, but the requirement is for the variable to be editable at the RITM level as well as the catalog task level and it needs to be mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 12:01 PM
There are likely a few ways to solve this, but a quick and simple method would be to create a hidden and ready-only variable (through UI policy) on your catalog item named something like "Item Approved." Once the requested item is approved, you can set this variable to "True" in your flow, and then create a UI Policy where Item Approved | is | True, and make sure both Applies on Catalog Tasks and Applies on Requested Items are checked, and Applies on a Catalog Item view is unchecked.
If you're comfortable with scripting, you could also create an onLoad() client script and check the value of the approval variable and then set the field mandatory/not mandatory based on that value. In my PDI the approval variable has the same name on the RITM and SCTASK so a single script should be all that is needed (make sure that this only runs on the SCTASK/RITM just like the UI Policy above).
Also, remember to not set the variable as mandatory on its definition, otherwise client scripts and UI policies will have no effect on it.
Hope that helps! Let me know if you need some examples of either method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 02:32 PM - edited ‎05-27-2025 02:32 PM
@Zach N , I would love to see an example. I am trying to wrap my head around trying to set the "item approved" variable to "true" in my flow.
I am still learning my scripting.