Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Variable values not getting cleared on request summary

siqbal
Tera Contributor

I have a form with several Catalog UI Policies configured. When I fill out a field on the form and then change my selection in a question above it, the variable value is cleared on the form as expected, based on the Catalog UI Policy. However, the cleared variable still appears in the Request Summary/Additional Details section. Since our approval email pulls data from the Request Summary/Additional Details, variables that are no longer visible on the form are being included in the email, even though they were cleared on the form itself.

I’ve tried various approaches to ensure these cleared variables don’t appear in the Request Summary, including using Catalog UI Policies, but the issue persists. I even built a script to clean them out, which works perfectly, but my manager wants this resolved without relying on a script. These variable does not appear on request item or the catalog task just on request summary. Can not hide the variable itself from summaries as we still want them to be sent out when end user does select/ fill them out.

Any help / suggestions would be apricated.

Thanks  

5 REPLIES 5

Yes, I was able to fix the issue. Here's how:

To make a variable visible based on another variable's value, you first need to ensure the variable is initially visible. For example, let's say we have a variable called A (with values 1, 2, and 3). When A is set to 1, we want to make another variable, B, visible.

To achieve this, you can create a catalog UI policy with the following logic:

  • If the value of A is not 1, then hide variable B and clear its value.

Keep in mind that the "Clear Value" action in a catalog UI policy only works when the variable is hidden, not when it is made visible.

  • If A = 1, B becomes visible (no clearing of value happens).
  • If A ≠ 1, B is hidden, and its value is cleared automatically.

I hope this helps clarify the process!