- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 12:08 AM - edited 12-03-2023 03:57 AM
How can we fetch the value of a variable from a normal and use it inside through catalog client script.
eg. g_form.getValue('variable_name');
OR
g_form.get('variable_set . variable_name');
OR
g_form.getDisplay('variable_set . variable_name');
g_form.get('variable_name');
g_form.getDisplayValue('variable_name');
No option worked.
Please help and correct me.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 05:44 PM
Hi @Asmita7
At catalog item level you can access the single row variable set variables but for multi row variable set works different.
You can get the JSON data of MRVS at Catalog Level by using
var mrvs_data = g_form.getValue('YOUR MRVS INTERNAL NAME');
mrvs_data = JSON.parse(mrvs_data);
Then you can iterate through the JSON object to get the value you want.
Please mark my answer helpful and accept as a solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 01:00 AM
Hi @Asmita7
Are you writing your Client Script at Catalog Item level or Variable Set level?
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 01:08 AM - edited 11-21-2023 10:30 AM
Hi @AnveshKumar M ,
Thank you for time.
Onchange catalog CS at variable set level.
When I use Catalog Item then MRVS is not available in variable name to apply onChange CS.
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 05:44 PM
Hi @Asmita7
At catalog item level you can access the single row variable set variables but for multi row variable set works different.
You can get the JSON data of MRVS at Catalog Level by using
var mrvs_data = g_form.getValue('YOUR MRVS INTERNAL NAME');
mrvs_data = JSON.parse(mrvs_data);
Then you can iterate through the JSON object to get the value you want.
Please mark my answer helpful and accept as a solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 04:44 AM
Hi @AnveshKumar M ,
I want to fetch value from SRVS variable inside MRVS through catalog client script.
Please suggest.