How to access order guide variables to request item workflow ??

KM SN
Tera Expert

I have associate type as a choice variable and HR and IT as a reference variables on order guide once we submitted there are multiple request items going to generate. 

 

if associate type is HR , two reference variables will populate groups automatically and if it is IT only IT variable will populate group.

for one of  RITM I need to configure workflow and based on order guide variables only I need to send approvals to HR and IT groups depends on associate type.

how to access them in workflow is hurdle for me?  and the logic need to be used in workflow ?

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hi,

Unfortunately, accessing order guide variables has always been a bit of a struggle. Even accessing them in the order guide script field on the order guide itself, is a bit of a struggle. Here's my article how to achieve that: https://www.servicenow.com/community/developer-articles/how-to-access-order-guide-variables-for-use-... 

 

Beyond that, you can't really access them in the workflow and the traditional way of handling it would be to set a "hidden" variable on the related catalog items involved with the order guide to the value you need and then use that hidden variable within your workflow to then go from there.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi @Allen Andreas  thanks for the reply and I am following the later one as you said by hiding them.

there I need to send approval to the group which is mentioned in the variable but if you can see the 2nd approval is automatically completing without asking for approval.

I tried with current.variables.tower where without mentioned sys_id also but no use. can i get any help over here?


ts-1.pngts-2.png

Hi,

Thanks for providing more information. So the issue you're talking about isn't necessarily related to what your original question was about. You originally asked how to access order guide variables, to which I responded to that.

 

For this new issue, which is a 2nd question essentially, within your workflow you'd need to check the value for the variable you're trying to access. Does current.variables.tower really have a value? If it's a reference field, it's already a sys_id, so you don't need to add .sys_id to it, it's already there. Additionally, if you're testing this as an admin, then it may skip approvals and you'd want to simulate this by impersonating an end-user and testing as them.

 

Since it's auto-approving and not skipping, then you'd want to check the value of the variable, review the table for which this workflow is running on, don't test as an admin, but as an end-user, and consider adding perhaps a timer activity (of maybe 3-5 seconds) in between these two approvals to let the flow slow down and not rush through.

 

Alternatively, I'd recommend building this out in Flow Designer and not use legacy workflow if this is a new workflow.


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!