Known issue - clear variable value on ui policy action not working
variables may still be populated on the generated RITM! Need to check with ServiceNow if this is a known issue > UPDATE: you need to tick the run on RITM and task checkboxes, as well as the cat item
However, another issue occurs whereby variables are blanked when you add to the cart. Referred this back to ServiceNow who came back with this update:
So in order to fix the issue we need to create duplicate UI policy where we need to select "clear the variable value" set to "false" and uncheck the "on load" option from the UI policy. 6. Another UI policy where "clear the variable value" set to "true" and check the "on load" option from the UI policy.
workaround - uncheck the 'clear variable value' flags (so it also works when adding item to the cart as opposed straight checkout)
onSubmit client script code:
(g_form.isVisible only works in SP)