ServiceNow Mulesoft Integration to move excel from ServiceNow to Mulesoft and then SAP?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
How to complete ServiceNow Mulesoft Integration to move excel from ServiceNow to Mulesoft and then SAP for Custom Application in Australia?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
You can split this integration into two parts.
Part 1: ServiceNow → MuleSoft
- Make sure the Excel file is stored as an attachment (sys_attachment) on your custom app record.
- Ask the MuleSoft team for the API endpoint, authentication details (OAuth or Basic) and the expected payload format.
- Create an outbound REST Message (System Web Services > Outbound > REST Message) pointing to the MuleSoft endpoint. [github.com]
- Send the file using one of these options, depending on what MuleSoft expects:
Option When to use How
| Binary body | MuleSoft accepts the raw file | request.setRequestBodyFromAttachment(attachmentSysId) [servicenow.com] |
| JSON + Base64 | MuleSoft expects a JSON payload with the file content inside | Read the attachment with GlideSysAttachment.getBytes() and encode it with GlideStringUtil.base64Encode() [support.se...icenow.com] |
| Multipart/form-data | MuleSoft expects the file plus other fields | Use the IntegrationHub REST step with request type Multipart, where the attachment value is the sys_id of the attachment record. Don't set the Content-Type header manually. [servicenow.com] |
Example for the Base64 option:
Wrap the call in a Script Include and trigger it from a Business Rule, UI Action or Flow, depending on when the file should be sent.
Part 2: MuleSoft → SAP
This is configured on the MuleSoft side. Mule receives the file, then maps and transforms it for SAP (for example with DataWeave) and calls the SAP interface. Your MuleSoft/SAP team will need to confirm the SAP endpoint and format.
Other things to check
- Use a Credential record or Connection alias for authentication. Don't hardcode secrets in the script.
- If MuleSoft sits on a private network, you may need a MID Server.
- Log the response status and body, and add retry or error handling for failed calls.
- If the file is large, check the payload size limits on both ServiceNow and MuleSoft.
Reference: the community article on sending attachments to third-party tools covers the same approach. [servicenow.com]
Thanks.
If my response helped, please mark it as correct.
