- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 10:12 PM
I want to get the value of a variable in a variable set in a catalog client script.
How do I set up the catalog client script?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 10:57 PM
Hi Miyu,
Is your variable set a normal variable set or multirow variable set?
For a normal variable set you can retrieve the value as follow:
var a = g_form.getValue('yourvariablename');
For multiRow variable set following is the syntax:
var serv = g_form.getValue('variableSetName');
var servData = JSON.parse(serv);
After parsing the JSON you can reterive the values:
var a = servData[i].yourvariablename;
here i is the index from which you want to reterive data.
Also you can define an array and store data in that array if there is multiple values.
var appSerSysIDList = [];
for (i = 0; i < servData.length; i++)
appSerSysIDList = appSerSysIDList + servData[i].yourvariablename+ '\n';
g_form.setValue('varName_where_you_want _to_store', appSerSysIDList.trim());
Please reach out if you need more clarification regarding multirow variable set.
Hope this helps.
Please mark the answer correct/helpful as applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2025 09:31 AM
Hi.
And if the variable is in a variable set?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2021 10:57 PM
Hi Miyu,
Is your variable set a normal variable set or multirow variable set?
For a normal variable set you can retrieve the value as follow:
var a = g_form.getValue('yourvariablename');
For multiRow variable set following is the syntax:
var serv = g_form.getValue('variableSetName');
var servData = JSON.parse(serv);
After parsing the JSON you can reterive the values:
var a = servData[i].yourvariablename;
here i is the index from which you want to reterive data.
Also you can define an array and store data in that array if there is multiple values.
var appSerSysIDList = [];
for (i = 0; i < servData.length; i++)
appSerSysIDList = appSerSysIDList + servData[i].yourvariablename+ '\n';
g_form.setValue('varName_where_you_want _to_store', appSerSysIDList.trim());
Please reach out if you need more clarification regarding multirow variable set.
Hope this helps.
Please mark the answer correct/helpful as applicable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2022 04:04 AM
Hi
Can you please help me achieving this through workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2025 09:36 AM
g_form.getValue('variableName');