Attachment is not getting added from mobile input screen to the record

sumanpan
Tera Contributor

Hi All,

 

I have created a button(Function) in the mobile app, When it is clicked a input screen opens up with some set of inputs required by the user along with the adding attachment.

Once it is submitted, I am able to get the values from the input fields but the attachment is not copied over to the record. I have used the below function to add the attachment in the form but it did not work.

 

actionResult.addAttachment("attach", 'incident',gr.getUniqueValue()); //where "attach" is the input name from above screenshot, and "incident" is the table name (Application - FSM)

 

Please let me know if i am missing anything

1 ACCEPTED SOLUTION

Hemant19
Kilo Guru
9 REPLIES 9

You mean through the above process?

Yes it is possible to save attachment in the custom table

I need help please share me code, in mobile application. 

Saurabh Singh6
ServiceNow Employee
ServiceNow Employee

@Pranav Bhagat  Can you please help @Hemant19  with this? He is trying to save an image in a custom table using a Mobile Studio. 

Zackery Reynold
Mega Sage

Can you give me some insight on how you accomplished this? I'm having this exact issue. 

 

actionResult.addAttachment("attach", 'incident',gr.getUniqueValue());

 

Change   gr. getUniqueValue() 

Example

var now_gr= new GlideRecord(x_tablename) 

actionResult.addAttachment("attach", 'incident',now_gr.getUniqueValue());

 

Or you can pass sys_id of table