- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 03:10 AM
On doing a GlideAjax I am getting a String written in JSON format.
var str ="var data = {"value1": "abc","value2": "def","value3": "ghi"};";
Now from this string I want to fetch individual parameters from this data variable and get output of individual.
Value1 = abc
Value2 = def
Value3 = ghi
Please let me know how from the output string which has a variable declaration of var data, I can get my individual output.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 03:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 03:22 AM
Hi Ankur,
I am getting the entire thing as a string
String: "var data = { "value1": "abc", "value2": "def", "value3": "ghi" };"
from here I want to convert it to JSON and then extract.
So please tell me how to first convert this to JSON
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 03:26 AM
Hi,
You can convert string data to JSON by using the below example:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 04:05 AM
Hi,
You can convert only ({"value1": "abc","value2": "def","value3": "ghi"}) to the JSON.
Not like given by you, So use the code like below: