In the payload one variable value is resulting with undefined.

AnandKumar1
Tera Expert

Hi Team,

I have an SR that once catalog submitted after approval the payload will be sent to azure and fulfillment process will continue the flow. 

 

Based on the selecting the subscription selecting the payload differs. One variable (select box) which that alone sending as undefined in the logs.

 

AnandKumar1_0-1682396488793.png

 

Below my script:

 

body1='{"InfoSeC":"'+current.variables.info_security_subs.getDisplayValue()+'","requestor_object_instance_id":"'+current.variables.application_name_subs.asset_tag+'","case":"Subscription","requestNumber":"'+new1+'","Connected VNET region":"'+current.variables.connected_vnet_region_subs_aks+'","Connected VNET Size":"'+current.variables.connected_vnet_size_subs_aks+'","Platform landing zone":"'+current.variables.platform_landing_zone.toString()+'"}';

 

Below are my sys_logs:

{"InfoSeC":"Open","requestor_object_instance_id":"300333","case":"Subscription","requestNumber":"36b82813871e65d07013cbb5cebb3593","Connected VNET region":"Azure West Europe","Connected VNET Size":"21","Platform landing zone":"undefined"}

 

The only difference in that payload is rest all from variable set and last one ("platform landing zone") is retriving from variable on the catalog. Please assist what I am missing here.

 

Thanks.

1 ACCEPTED SOLUTION

@AnandKumar1 

are you sure there is no space in the variable name at the end?

Did you try to hard-code the RITM sysId and check if you can get the variable value in background script?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Mohith Devatte
Tera Sage
Tera Sage

Hello @AnandKumar1 ,

 

Make sure your variable name is correct and also try to use current.variables.platform_landing_zone.getDisplayValue()

 

Let me know is this helps 

Also if you find this answer useful please mark it correct

Thanks

Hi Mohith,

Thanks for your response. I have tried with current.variables.platform_landing_zone.getDisplayValue() as well. Still getting the undefined.

 

Thanks,

Ankur Bawiskar
Tera Patron
Tera Patron

@AnandKumar1 

can you share variable configuration screenshot?

It's a select box variable right?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Thanks for your reply. Yes, this variable is Select Box and have 2 choices. 

 

AnandKumar1_0-1682404557056.png

 

AnandKumar1_1-1682404572252.png

 

Thanks.