Get Value of user_image type field

Renuka8
Kilo Guru

I have a user_image type field in incident form, i want to get the value of this field basically the photo which is uploaded and onclick of ui action link ui page pops up to show this photo. Please suggest how can i get the value of this user_image field.

1 ACCEPTED SOLUTION

Sorry for confusion. I missed single quote in Id name.



var id = document.getElementById('image.sys_user.photo').value;


window.location = 'https....instance_name.service-now.com/sys_attachment.do?sys_id='+id;


View solution in original post

7 REPLIES 7

Renuka8
Kilo Guru

Rephrasing the question: While calling a UI Page through UI Action link how can I pass a parameter to UI page of "type user_image field"


Bhavesh Jain1
Giga Guru

Let us take an example of user record where you already have a profile photo field of type user_image.


Write a sample onLoad client script on this user record.



var id = document.getElementById(image.sys_user.photo).value;


window.location = 'http....instance_name.service-now.com/sys_attachment.do?sys_id='+id;




This will show a popup to save or Open the loaded image. Let me know if this makes sense.





Regards,


Bhavesh


IGate-logo.png


http://www.igate.com


Hi Bhavesh,



I am unable to get the value using below line of code. Can you please explain the same.



document.getElementById(image.sys_user.photo).value


Have you uploaded the photo in the user record?