Smart Attachment Handling for Mobile Agent Applications
New article articles in ServiceNow Community
·
May 30, 2026
·
article
Managing Bulk Attachment Fields in Mobile Agent
Overview
This article explains the implementation approach for handling bulk attachment fields in Mobile Agent applications. The solution focuses on managing attachments uploaded from mobile screens and mapping them to specific attachment fields on a table instead of directly attaching them to the record.
The implementation also includes:
Uploading multiple attachments through a custom mobile input page
Backend automation for attachment handling
Old attachment cleanup during updates
Displaying attachment count information on mobile list screens
This approach improves attachment management, provides better user visibility, and maintains clean attachment records within the system.
Requirement
In Mobile Agent, attachment handling for custom attachment fields is not directly supported in the same way as standard record attachments. The requirement was to:
Allow users to upload multiple attachments from Mobile Agent.
Store attachments against specific attachment fields on the target table.
Replace old attachments when new files are uploaded.
Display attachment-related information on the mobile list screen.
Solution Architecture
The complete solution was implemented using the following components:
Mobile Input Page
Backend Business Rules
Attachment Cleanup Logic
Mobile List Screen Enhancements
1. Create Mobile Input Page for Attachments
Objective
A dedicated mobile input page was created to allow users to upload multiple attachments from Mobile Agent.
Implementation
A custom mobile page/input form was developed.
Attachment upload fields were added for required attachment categories.
Users can select and upload multiple files directly from the mobile application.
Benefits
Easy attachment upload experience for mobile users
Supports bulk attachment handling
Better control over attachment processing
2. Backend Business Rule to Map Attachments to Field-Level Attachments
Objective
By default, Mobile Agent uploads attachments directly to the record. However, the requirement was to associate attachments with specific attachment fields on the table.
Implementation
A backend Business Rule was created to:
Capture attachments uploaded from the mobile page
Identify the target attachment field
Move or map the attachments appropriately
Maintain attachment references for field-level management
Key Logic
The Business Rule performs the following actions:
Detect newly uploaded mobile attachments
Identify the corresponding attachment field
Associate attachments with the correct field
Maintain attachment metadata for future operations
Benefits
Structured attachment handling
Field-wise attachment segregation
Better attachment tracking and maintenance
3. Business Rule for Old Attachment Cleanup
Objective
When users upload new attachments, the previous attachments must be removed to avoid duplicate or outdated files.
Problem Statement
Without cleanup logic:
Old attachments remain in the system
Duplicate files accumulate
Storage usage increases unnecessarily
Implementation
An additional backend Business Rule was created to:
Detect when new attachments are uploaded
Identify existing attachments linked to the same field
Delete old attachments before saving the new ones
Process Flow
User uploads new attachment
System checks for existing attachments
Old attachments are deleted
New attachments are attached successfully
Benefits
Prevents duplicate attachments
Keeps records clean
Reduces unnecessary storage usage
Ensures users always see the latest files
4. Display Attachment Information on Mobile List Screen
Objective
Users should be able to quickly identify how many attachments are associated with a record directly from the mobile list screen.
Implementation
Separate sections were added on the mobile list screen to display:
Attachment category name
Number of attachments uploaded
Visual indication for attachment availability
Example Display
| Attachment Type | Count |
|---|---|
| Repaired Equipment | 2 |
| New Equipment | 1 |
| RCA Documents | 3 |
Benefits
Improved mobile user experience
Quick attachment visibility
Easy verification of uploaded documents
Better operational tracking
End-to-End Flow
Complete Workflow
User opens Mobile Agent input page
User uploads bulk attachments
Attachments are temporarily stored
Backend Business Rule maps attachments to field-level attachment references
Existing old attachments are removed automatically
New attachments are saved
Attachment count is displayed on the mobile list screen
Technical Components Used
Mobile Components
Mobile Input Page
Mobile List Screen Configuration
Attachment Upload Controls
Backend Components
Business Rules
GlideRecord Operations
Attachment APIs
Attachment Cleanup Logic
Advantages of This Approach
Supports bulk attachment handling in Mobile Agent
Enables field-level attachment management
Automatically removes outdated attachments
Provides better visibility on mobile screens
Improves overall attachment lifecycle management
Conclusion
This implementation provides a scalable and structured solution for handling bulk attachments in Mobile Agent applications. By combining custom mobile pages, backend Business Rules, and attachment cleanup mechanisms, the system ensures efficient attachment management while maintaining a clean and user-friendly mobile experience.
NowMobile #NowMobileAgent #FSM
Thank you
https://www.servicenow.com/community/developer-blog/smart-attachment-handling-for-mobile-agent-applications/ba-p/3550900