- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 06:51 PM
I have a multi row variable set and I need to copy over the data into multi line text to present data to user on Tasks.
How do I parse the below to get data as AIX,BIX,CIX
[{"vr_table_names_2":"AIX"},{"vr_table_names_2":"BIX"},{"vr_table_names_2":"CIX"}]
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 07:06 PM
Hi,
Ideally, we'd love to see what you've attempted thus far, so we can help you learn, but...
If what you're getting is what you've shown, then you can use something like to this get the data formatted as you need:
var array = [];
var obj = [{"vr_table_names_2":"AIX"},{"vr_table_names_2":"BIX"},{"vr_table_names_2":"CIX"}];
for (var i = 0; i < obj.length; i++) {
array.push(obj[i].vr_table_names_2);
}
gs.info(array.toString()); //or just array if you want it in array format
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 07:06 PM
Hi,
Ideally, we'd love to see what you've attempted thus far, so we can help you learn, but...
If what you're getting is what you've shown, then you can use something like to this get the data formatted as you need:
var array = [];
var obj = [{"vr_table_names_2":"AIX"},{"vr_table_names_2":"BIX"},{"vr_table_names_2":"CIX"}];
for (var i = 0; i < obj.length; i++) {
array.push(obj[i].vr_table_names_2);
}
gs.info(array.toString()); //or just array if you want it in array format
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 07:51 PM
Thanks , I missed obj[i] in my code
array.push(obj[i].vr_table_names_2);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2022 08:07 AM
Hi,
We wouldn't know as you didn't share it. In the future, please also share what you have, etc. so we can help you learn.
Glad you're good to go now though! 🙂
Take care!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
