How to use g_form.save() in client script

RAMANA MURTHY G
Mega Sage
Mega Sage

Hello community,

 

I wanted to use g_form.save() in onLoad catalogue client script for one scenario

 

Variable data populated from third party integration. But variables unable to read in flow. If we save the RITM form for one more time after immediate  data population from integration, flow is able to read the variables.

 

So that, I wanted to use g_form.save() in onLoad client script. But after using this it went in a loop. I wanted to know is there any best approach to use g_form.save() 

 

Or is there any approach to able to read variables in a flow after variable data populated from third party integration.

 

Thank you in advance.

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer
6 REPLIES 6

-O-
Kilo Patron
Kilo Patron

If the data is coming from a 3rd party integration and the form is saved immediately afterwards, there is no need to do client stuff.

The integration should be executed server side, which would fetch the needed data and would create the catalog item using the sn_sc APIs.

Hello @-O- ,

Thank you for your response, actually data coming from 3rd party integration to the Order Guide Form, in the order guide we have catalog items and one of the catalog item data is cascading from the order guide, which is coming from integration. That catalog item data got populated from cascading and some of the client scripts. So, that data is not committed at that time, flow is unable to read data in a get catalog variables action.

 

Hope you understand the scenario.

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer

Not sure I understand, if the variable is cascading down from the order guide to the catalog item. Once you submit it will save, why would your flow run before the order guide has been submitted? 

Hello @DanielCordick ,

remaining flow executed as expected, but get catalog variables action is unable to read variable values which are cascaded and filled with client script. 

 

If I save RITM form once more before flow reads catalog variables, that action can read variable values. This problem is generated when data comes from Integrations. If we give data manually, this problem not getting generated. Flow executes as expected.

 

Hope you understand the scenario

 

 

Please mark my answer helpful  & correct if it helps you
Thank you

G Ramana Murthy
ServiceNow Developer