- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 06:58 AM
I have an aggregate data resource that returns a json object:
{ "data": { "GlideAggregate_Query": [ { "count": 409 } ] }}
On my page i have a stylised text component and i can bind the output of the DR to its text property:
@Data.aggregation_query_1.output.data.GlideAggregate_Query.0.count
However i am not able to access the DR from within the scripted property value script using the api
e.g. var val = api.data.aggregation_query_1.output.data.GlideAggregate_Query.0.count;
Intellisense gets lost after api.data.aggregation_query_1
Am i doing something wrong?(I guess so)
Is it possible? If yes how?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 08:21 AM
I just realised what was wrong:
var val = api.data.aggregation_query_1.output.data.GlideAggregate_Query.0.count;
The array reference is not right, the correct syntax is:
var val = api.data.aggregation_query_1.output.data.GlideAggregate_Query[0].count;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2023 08:21 AM
I just realised what was wrong:
var val = api.data.aggregation_query_1.output.data.GlideAggregate_Query.0.count;
The array reference is not right, the correct syntax is:
var val = api.data.aggregation_query_1.output.data.GlideAggregate_Query[0].count;