Now Mobile Attachment Input Not Attaching File to Incident Created via Scripted Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi everyone,
I'm working on a Now Mobile application where users can create an Incident using an Input Form Screen and i have added Scripted Action for attachment.
Setup
Input Form Screen
Screen: Create Incident
Added an input field:
Name: attachment
Type: Attachment
Scripted Action
(function WriteBackAction(parm_input, parm_variable, actionResult) {
actionResult.addAttachment( "attachment", "incident", gr.getUniqueValue());
})(parm_input, parm_variable, actionResult);
Issue
The Incident is created successfully from the mobile app.
The file upload appears to complete successfully.
However, the attachment is not associated with the created Incident.
No attachment appears on the Incident record.
No attachment appears in the Activity Stream.
What I Found
Instead of seeing a record linked to the Incident in sys_attachment, I see data like:
[
{
"email_table_name":"sys_email",
"email_sys_id":"c0a0ca9b838d8750145417447daad306",
"job_id":"6fd002db838d8750145417447daad3ed",
"state":"SENT"
}
]
It seems the attachment is being processed through sys_email rather than being attached to the Incident record.
Questions
Has anyone successfully used actionResult.addAttachment() with an Attachment Input in Now Mobile?
Are there additional steps required after addAttachment() to associate the uploaded file with the Incident?
Should the attachment input automatically create a record in sys_attachment, or is additional configuration required?
Has anyone seen attachments being routed to sys_email instead of the target table?
Any guidance would be greatly appreciated.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
36m ago - last edited 35m ago
Hi @TEJAS
Check This:
Attachment is not getting added from mobile input screen to the record
Servicenow Doc: Configure an action item
Servicenow Doc:Script code for storing user-selected attachments in the database
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
34m ago
Refer these videos as well:
https://www.youtube.com/watch?v=JeaPgYgLyiw
https://www.youtube.com/watch?v=vqFe-8PeORQ
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti