How to do dot-walking in JSON when attribute are not static?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:03 AM
Hi Team,
How can we read an attribute when dot-walking attribute are not static.
example :- I want to read an attribute - 'cancel' (static), but for reading this I need to dot-walk from result.
Issue is, attribute - '11633', 'Underground Terminal', '3212073', '2468', 'Location' are not static, attribute will get change dynamically based on the particular request.
{
"result": {
"11633": {
"Underground Terminal": {
"3212073": {
"2468": {
"Location": {
"static": {
"cancel": "false"
},
"static": {
"cancel": "false"
}
}
}
}
}
}
}
}
is this case how we should dot-walk non static attribute ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:07 AM
Did you explore in javascript? using that method you can get the desired value.
Refer :https://stackoverflow.com/questions/3068534/getting-javascript-object-key-list
Please mark the answer correct/helpful accordingly.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 10:23 PM
@Vijay Kumar21 did this work for you?
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:10 AM
Hi Vijay,
Just a suggestion, to convert it to string and then may be try using subString()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2023 01:20 AM
Unless it's static you won't know what to fetch
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader