- 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-10-2015 11:23 AM
Could you give us some more info on what "page" you're trying to get an image into and what the source of the image is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 09:46 PM
Hi Brad,
I am trying to add a image to dynamic block to a page and on click of the image the details are getting displayed.
Now I want to dynamically get the image from database. I have written a Jquery script to display the details on click of the image and this is using the id.
Since I have many images could you please help me how can I dynamically get the image from database.
Regards,
kavya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 11:24 AM
Hi Kavya,
Can you provide more information? At a minimum, we need answers to the following questions to begin to offer suggestions:
What page are you trying to add an image to?
How are you trying to add the image?
Where does the image come from?
What makes it dynamic- are you trying to add it based on user input?
What have you tried already?
What does your code currently look like?
Thanks
Cory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 09:45 PM
Hi Cory,
I am trying to add a image to dynamic block to a page and on click of the image the details are getting displayed.
Now I want to dynamically get the image from database. I have written a Jquery script to display the details on click of the image and this is using the id.
Since I have many images could you please help me how can I dynamically get the image from database.
Regards,
Kavya