Retrieve files from SharePoint to ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2025 12:05 AM
I have a requirement to retrieve a zip file from Microsoft SharePoint to ServiceNow and to unzip this to get a particular file for later use. What is the best way to achieve this and please help with the process?
Additionally, I could see 'Microsoft SharePoint Online Spoke', but will this be effective with all features if the integration hub package is Standard?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2025 01:44 AM
Hi @Parvathy B1
Yes, The Microsoft SharePoint Online spoke can help here.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2025 10:52 PM
Apart from 'Microsoft SharePoint Online Spoke' ,is there an alternate method to retrieve the file and attach in a record? Also the step action 'zip/unzip' is only available for certain integration hub entitlement, so does ServiceNow support unzip operation with script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2025 04:35 PM
Tech Apps' ServiceNow certified application DocIntegrator can provide a robust and often simpler solution for retrieving a zip file from SharePoint to ServiceNow and accessing its contents, potentially bypassing some of the limitations you might encounter with the standard "Microsoft SharePoint Online Spoke" and Integration Hub entitlements.
Here's how DocIntegrator can help:
DocIntegrator's Approach:
DocIntegrator provides actions and APIs that allow you to interact with SharePoint files directly within ServiceNow workflows (Flow Designer) or scripts. This includes the ability to download files.
Process using DocIntegrator:
Establish a Secure Connection to SharePoint:
- Configure a connection alias in DocIntegrator to your Microsoft SharePoint Online environment. This typically involves setting up OAuth 2.0 authentication with Azure AD.
Use a Flow Designer Flow (Recommended):
- Create a new Flow Designer flow triggered by your desired event (e.g., a record creation, a scheduled job, a user action).
- Add a DocIntegrator Action: Look for actions related to file operations in SharePoint. A likely action would be something like "Download File from SharePoint" or "Get File Content from SharePoint".
- Configure the Download Action:
- Select your configured DocIntegrator connection alias.
- Specify the full URL or the relative path to the zip file within your SharePoint library.
- The action will retrieve the zip file content.
Unzipping the File in ServiceNow:
- DocIntegrator Might Offer Unzip Capabilities (Check Documentation): Some advanced file management features might be included within DocIntegrator. Review its documentation to see if it provides a direct "Unzip" action or function. If so, you could directly use that action, providing the downloaded zip file content.
- ServiceNow Scripting for Unzipping (Fallback): If DocIntegrator doesn't have a built-in unzip action, you can use ServiceNow scripting (JavaScript) to handle the unzipping process. ServiceNow's scripting environment has access to libraries that can handle zip file operations. You would add a "Script Action" in your Flow Designer flow after the DocIntegrator download action.
- You would need to handle the downloaded file content (likely as a GlideString or similar) within the script.
- Look for JavaScript libraries or ServiceNow APIs that allow you to work with zip archives (you might need to search the ServiceNow developer documentation or community for examples).
Accessing the Particular File:
- Once the zip file is unzipped (either by DocIntegrator or via script), you'll need to navigate the extracted files to locate the specific file you need. This would likely involve further scripting within the "Script Action."
Using the Particular File:
- After locating the desired file, you can then use its content for your subsequent needs (e.g., parsing data, attaching it to a ServiceNow record). For attaching, you can use the GlideSysAttachment API in your script.
Effectiveness of "Microsoft SharePoint Online Spoke" with Integration Hub Standard:
The "Microsoft SharePoint Online Spoke" can be effective for basic file operations like downloading. However, the availability of advanced actions like "zip/unzip" is often tied to higher-tier Integration Hub entitlements (Professional or Enterprise). With the Standard package, you might be limited in the built-in actions available for complex file manipulation.
Alternate Method to Retrieve and Attach (Beyond the OOB Spoke):
- DocIntegrator is the Primary Alternate: As outlined above, DocIntegrator provides a direct and often more feature-rich way to interact with SharePoint files compared to the basic capabilities of the Standard Integration Hub Spoke. It handles authentication and file retrieval efficiently.
ServiceNow Support for Unzip Operation with Script:
Yes, ServiceNow supports unzip operations using JavaScript within script actions. You would typically need to find and utilize a suitable JavaScript library for handling zip archives within the ServiceNow scripting environment. You might need to explore the ServiceNow developer community or external JavaScript resources for examples and libraries you can adapt.
Why DocIntegrator is a Good Choice:
- Simplified SharePoint Interaction: DocIntegrator abstracts away the complexities of the SharePoint API.
- Robust Authentication: Handles secure authentication with SharePoint Online.
- Potentially More Features: Might offer more comprehensive file handling capabilities than the Standard Integration Hub Spoke.
- Direct File Content Access: Allows you to easily retrieve the raw content of the zip file for further processing in ServiceNow.
In summary, using DTech Apps DocIntegrator in conjunction with a Flow Designer flow and potentially ServiceNow scripting for the unzip operation is the best way to achieve your requirement. DocIntegrator simplifies the SharePoint file retrieval, and ServiceNow scripting provides the flexibility to handle the unzip and file extraction logic. Remember to consult the DocIntegrator documentation for specific actions and API details.