- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:56 AM - edited 10-27-2022 11:57 AM
Good Evening,
I have a really odd problem, assigning some text to a data object but it won't display correctly on the html template.
Server Side:
var config = new GlideRecord(gs.getProperty('table'));
config.addQuery('number', 'LIKE', data.parent_configuration);
config.query();
if(config.next()) {
data.desc2 = config.description;
}
Html:
<div ng-if="data.show_desc == 'true'">{{data.desc2}}</div>
Result:
Result is an empty Object but when I check the logs, I can see its being picked up correctly:
Not sure what I am doing wrong... sigh
Any Ideas?
Kind Regards
Ashley
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 05:55 AM
Good Afternoon,
Thank you all for the replies, I managed to resolve it, a few hours lost and all I needed to do was add .toString() on the end.... doh
End Result:
data.desc2 = config2.description.toString();
Kind Regards
Ashley

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 03:07 PM
Try one of these
{{::data.desc2}}
{{::c.data.desc2}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 12:32 AM
Good Morning,
Thank you for the reply, gave it a go and didn't work for me.
This is a scoped application as a side note, shouldn't make a difference.
Kind Regards
Ashley

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 03:11 PM
Try JSON.stringify() on return from server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 12:37 AM
Good Morning,
I think this is what you meant:
data.desc2 = JSON.stringify(config2.description);
I gave it a go and the gs.logs were empty afterwards so I didn't get any results.
Kind Regards
Ashley