Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to upload an image from custom portal widget and show that image in the ticket created?

manmathpanda
Giga Guru

Dear Developers,

I am new to Service Portal and working on a custom portal widget where no record producer created instead all code are written in html for all fields of the form. like below

find_real_file.png

find_real_file.png

 

I have simply created 

<div class="row">
<label>Select a file: <input type="file" name="myFile"><br><br>

</div>

As i don't have idea how to create this, some code will helpful to me to achieve this?

Please help.

i want to create an attachment to upload passport images or files in the form and after submitting the form it should show in ticket as well.

 

Regards,

Manmath

 

 

 

5 REPLIES 5

ata._attachmentTable = "sc_req_item";//here put your table
	data.recordID = "46d91e8bdb800010feeb47823996190d";// this sys_id is of my instance, put your record or req sys_id so that it will be seen in REQ as well

instead of fixed data.recordID can we get dynamic record which is getting created, attachment should attach to it