- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 10:41 AM
Hi Everyone,
Im unable to get the image dynamically onto the page.How can I do it in servcienow?
your suggestions will be helful
Regards,
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2015 05:31 AM
Hi Kavya,
see below example..
i have one field of type of Image in one table.
now i want to display those images to the dynamic block.
so i have added a dynamic block to one page. and wrote below content.
<g:evaluate> | |
var images=[]; | |
var gr = new GlideRecord('x_11777_crappy_app_crappy_appppp_table'); | |
gr.query(); | |
while(gr.next()){ |
images.push(gr.photo.getDisplayValue());
} |
</g:evaluate>
<j:forEach items="${images}" var="jvar_color">
<g:breakpoint/>
<img id="${jvar_color}" src="${jvar_color}"></img>
</j:forEach>
so it will display images like shown below. and they will have different Id so u can use Jquery and reference them in your script.
Let me know if u have Questions.
(please mark helpful/correct/like if it helps)
Regards,
Rushit Patel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2015 12:53 AM
Hi Kavya,
are these images stored in some table? like on field type image?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2015 01:35 AM
Hi Rushit,
Yes I have stored the image in table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2015 05:31 AM
Hi Kavya,
see below example..
i have one field of type of Image in one table.
now i want to display those images to the dynamic block.
so i have added a dynamic block to one page. and wrote below content.
<g:evaluate> | |
var images=[]; | |
var gr = new GlideRecord('x_11777_crappy_app_crappy_appppp_table'); | |
gr.query(); | |
while(gr.next()){ |
images.push(gr.photo.getDisplayValue());
} |
</g:evaluate>
<j:forEach items="${images}" var="jvar_color">
<g:breakpoint/>
<img id="${jvar_color}" src="${jvar_color}"></img>
</j:forEach>
so it will display images like shown below. and they will have different Id so u can use Jquery and reference them in your script.
Let me know if u have Questions.
(please mark helpful/correct/like if it helps)
Regards,
Rushit Patel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2015 01:36 AM
Thanks Rushit and it works!