- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 11:35 PM
The request fields are not displaying for the "Request Fields" portal widget. Through logging and testing, I am getting a blank/empty array for the $sp.getVariablesArray() Portal API call. I have read through all of the documentation and there is nothing about how it works. It is confirmed working for the "Tickets Field" widget on their CSM catalog items. The version is Madrid : patch 1 : hotfix 2.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-17-2019 12:29 AM
I have out what is happening. On submit of the 'SC Catalog Item' widget, it redirects me to the REQUEST record page. If I return home and navigate to the REQUEST ITEM record it displays all the variables.
I imagine (just a guess) that the $sp.getVariablesArray() call grabs the current record on page. Since my variables were on the RITM and not the REQ it was showing an empty variable.
This is not a show stopper. If you navigate to the RITM in "My Requests" it will display variables.
Possible Resolutions:
1. (BEST OPTION) For some reason, I don't have the widget option "Successful Order Page" on the 'SC Catalog Item" widget. I am using the OOB SC Catalog Item in Madrid, so I'm not sure if this feature has been deprecated or I need to activate something to see this. If you see this option on your widget this the best solution to use. Follow the link below for instructions on how to configure:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0656003
2. Create a redirect client script onSubmit (Example: https://community.servicenow.com/community?id=community_question&sys_id=3b5ea866db35d7004816f3231f96...)
3. Customize the "Request Fields" widget to query on the RITM fields. Not sure if it's possible to play around with the $sp.getVariablesArray() to pull the RITM fields.\
4. (THE LAST POSSIBLE OPTION) I Wouldn't advise doing this, but you could clone and edit the "SC Catalog Item" widget and hardcode a redirect to the RITM.
Hope this helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-16-2019 11:53 PM
Hi,
please check the following thread, it might help you to understand how it works:
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thank you
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-17-2019 12:29 AM
I have out what is happening. On submit of the 'SC Catalog Item' widget, it redirects me to the REQUEST record page. If I return home and navigate to the REQUEST ITEM record it displays all the variables.
I imagine (just a guess) that the $sp.getVariablesArray() call grabs the current record on page. Since my variables were on the RITM and not the REQ it was showing an empty variable.
This is not a show stopper. If you navigate to the RITM in "My Requests" it will display variables.
Possible Resolutions:
1. (BEST OPTION) For some reason, I don't have the widget option "Successful Order Page" on the 'SC Catalog Item" widget. I am using the OOB SC Catalog Item in Madrid, so I'm not sure if this feature has been deprecated or I need to activate something to see this. If you see this option on your widget this the best solution to use. Follow the link below for instructions on how to configure:
https://hi.service-now.com/kb_view.do?sysparm_article=KB0656003
2. Create a redirect client script onSubmit (Example: https://community.servicenow.com/community?id=community_question&sys_id=3b5ea866db35d7004816f3231f96...)
3. Customize the "Request Fields" widget to query on the RITM fields. Not sure if it's possible to play around with the $sp.getVariablesArray() to pull the RITM fields.\
4. (THE LAST POSSIBLE OPTION) I Wouldn't advise doing this, but you could clone and edit the "SC Catalog Item" widget and hardcode a redirect to the RITM.
Hope this helps!