- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 12:05 PM - edited 05-27-2024 06:26 AM
Hello folks,
I created a custom UI Macro to dynamically display images according to the return from my Script Include.
I have already tested the Script and it is correctly returning the URL of the image, my UI Macro is also successfully displaying the image when I define my "title" variable as a String with the name of any film.
The problem is that there is a field called "name" in the table, where I can see it in the Form, but I cannot access it within my Macro UI in any way.
I have already tried the following codes:
<g:evaluate var="imageUrl" object="true">
//Examples of attempts
var title = current.name;
var title = g_form.getValue("name");
var title = jellyContext.getParameter('name');
//title variable is not filled in any way, only manually
var myScriptInclude = new OmdbUtils();
imageUrl = myScriptInclude.getImageUrl(title);
</g:evaluate>
None worked (current, g_form, jellyContext).
Using GlideRecord didn't work either.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 08:45 PM
Hi @Patrick Moura ,
Please have a look at this community post -
https://www.servicenow.com/community/developer-forum/get-vaule-from-field-to-ui-macro/m-p/1569127
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 08:45 PM
Hi @Patrick Moura ,
Please have a look at this community post -
https://www.servicenow.com/community/developer-forum/get-vaule-from-field-to-ui-macro/m-p/1569127
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 06:28 AM
Thanks @Anirudh Pathak, I resolved it using <script> instead of <g:evaluate>.