- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 07:07 AM
Hi Team,
We are using client controller to fetch values MRVS from catalog item
"[{\"asset_details\":\"0f19a6518787d11089e3c8490cbb35bb\",\"u_order\":\"1\",\"chargeable\":\"true\",\"amount\":\"\",\"shipto_loc\":\"Finland\",\"total_qty\":\"\",\"u_consumable\":\"4c61ce9e87d4a51089e3c8490cbb350b\",\"u_price\":\"\",\"IO:f50ea9bb8791251089e3c8490cbb3532\":\"false\",\"product_name\":\"ab775db51b31951009952f02604bcbeb\",\"max_qty\":\"\"}]"
Please help me parse and get respective values
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:48 AM
Please use below format:
var mvrs =
"[{\"asset_details\":\"0f19a6518787d11089e3c8490cbb35bb\",\"u_order\":\"1\",\"chargeable\":\"true\",\"amount\":\"\",\"shipto_loc\":\"Finland\",\"total_qty\":\"\",\"u_consumable\":\"4c61ce9e87d4a51089e3c8490cbb350b\",\"u_price\":\"\",\"IO:f50ea9bb8791251089e3c8490cbb3532\":\"false\",\"product_name\":\"ab775db51b31951009952f02604bcbeb\",\"max_qty\":\"\"}]";
var json = JSON.parse(mvrs);
for(var i = 0 ; i < json.length ; i++){
var assetDetails = json [i].asset_details;
var u_order= json [i].u_order;
}
And same for all the variables...
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:39 AM
Check this article.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 08:48 AM
Please use below format:
var mvrs =
"[{\"asset_details\":\"0f19a6518787d11089e3c8490cbb35bb\",\"u_order\":\"1\",\"chargeable\":\"true\",\"amount\":\"\",\"shipto_loc\":\"Finland\",\"total_qty\":\"\",\"u_consumable\":\"4c61ce9e87d4a51089e3c8490cbb350b\",\"u_price\":\"\",\"IO:f50ea9bb8791251089e3c8490cbb3532\":\"false\",\"product_name\":\"ab775db51b31951009952f02604bcbeb\",\"max_qty\":\"\"}]";
var json = JSON.parse(mvrs);
for(var i = 0 ; i < json.length ; i++){
var assetDetails = json [i].asset_details;
var u_order= json [i].u_order;
}
And same for all the variables...
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact!