Moving Files from SharePoint to ServiceNow via Microsoft Online Spoke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 10:13 AM - edited 04-02-2025 11:48 PM
Hello ServiceNow Community,
I’m working on a Flow Designer flow using the Microsoft Online Spoke to move files from SharePoint to ServiceNow. I have successfully set up access to the SharePoint folder and can retrieve files, but my challenge now is matching the "Pnumber" field in my custom ServiceNow table to the corresponding file title in SharePoint.
Once matched, attaching the correct file to the related ServiceNow record.
How would this flow be set up best?
****Edit, Files inside of folder all have different names is there a way to just grab any files within a folder.
Please advise, I have first time using spoke.
SharePoint files name example:
2023-PP-1234 John Doe 123456789
This name matches the custom table fields
Custom Table Field version
Pnumber Civilian First Name(firstName) Civilian Last Name(lastName) Znumber
2023-PP-1234 John Doe 123456789
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 05:42 PM
Thanks for your question! It highlights a common challenge when integrating SharePoint with ServiceNow. While you can achieve this using the Microsoft Online Spoke in Flow Designer, DTech Apps DocIntegrator offers a more robust and often simpler solution, especially for complex matching and file handling scenarios.
Here's a breakdown of how I'd approach your requirement and how DocIntegrator can help:
Understanding the Challenge:
You need to:
- Retrieve files from a SharePoint folder.
- Match a field in your ServiceNow table ("Pnumber") to the file title in SharePoint.
- Attach the correct file to the corresponding ServiceNow record.
- Handle the scenario where you might want to grab any file within a folder.
Limitations of the Microsoft Online Spoke in Flow Designer:
While the Microsoft Online Spoke can connect to SharePoint, it often requires significant scripting and complex logic within Flow Designer to:
- Iterate through files: You'll likely need loops and scripting to go through each file in the SharePoint folder.
- File Title Matching: You'll need to use script actions to extract the file title and perform the string comparison with your "Pnumber" field. This can be error-prone if file titles aren't perfectly consistent.
- Dynamic Attachment: Attaching the correct file dynamically to the ServiceNow record based on the match also requires scripting and careful handling of file streams.
- Folder-level Retrieval: Getting "any" file from a folder might require additional logic to determine which file to choose (e.g., the newest, the first one, etc.).
This can lead to:
- Complex and Fragile Flows: Flows become difficult to maintain and troubleshoot due to extensive scripting.
- Performance Issues: Iterating through large numbers of files in Flow Designer can impact performance.
- Increased Development Time: Building and testing these flows can be time-consuming.
How DTech Apps DocIntegrator Simplifies Things:
DocIntegrator is designed to bridge the gap between ServiceNow and SharePoint, providing a more streamlined and efficient way to handle document interactions:
- Simplified File Retrieval: DocIntegrator can be configured to retrieve files from SharePoint libraries or folders based on various criteria, often with less scripting than the Spoke.
- Metadata-Driven Matching:
- While not a direct "file title matching" function, DocIntegrator can work with SharePoint metadata. If you can ensure "Pnumber" is stored as a metadata field in SharePoint (which is a best practice), DocIntegrator can leverage that for more reliable matching.
- Even without metadata, DocIntegrator can be used in conjunction with scripting to facilitate title matching, but it often simplifies the overall process.
- Automated Attachment/Linking: DocIntegrator can automatically create links between SharePoint files and ServiceNow records, or even retrieve the file content itself if needed (though linking is generally recommended for performance).
- Folder-Level Flexibility: DocIntegrator can be configured to retrieve the latest file, files matching a specific pattern, or other criteria when you need a file from a folder.
Here's a general approach using DocIntegrator (and some potential scripting):
- Configure SharePoint Connection: Set up the connection between ServiceNow and SharePoint within DocIntegrator.
- Define Retrieval Criteria: Configure DocIntegrator to retrieve files from the relevant SharePoint folder.
- Matching Logic (if needed):
- If possible, store "Pnumber" as a metadata field in SharePoint. DocIntegrator can then use this metadata for direct matching.
- If you must rely on file titles, you might still need a small script within ServiceNow (e.g., a Business Rule or Script Include) to perform the title comparison, but DocIntegrator makes the file retrieval part easier.
- Attachment/Linking Action: Configure DocIntegrator to create a link or attachment to the matched SharePoint file within the ServiceNow record.
- Workflow Integration: Integrate this DocIntegrator action into your Flow Designer flow (or other ServiceNow workflow).
Benefits of DocIntegrator in this Scenario:
- Reduced Scripting: DocIntegrator minimizes the amount of complex scripting you need to write in Flow Designer.
- Improved Performance: Optimized for SharePoint interaction, DocIntegrator handles file retrieval more efficiently.
- Enhanced Maintainability: DocIntegrator's configuration-driven approach makes your solution easier to maintain and update.
- Greater Flexibility: DocIntegrator offers more flexibility in handling different file retrieval and linking scenarios.
In summary:
While the Microsoft Online Spoke can be used, DTech Apps DocIntegrator provides a more efficient, robust, and maintainable way to achieve your SharePoint file matching and attachment requirements in ServiceNow, especially when dealing with complex logic and potential performance concerns.
I'd be happy to discuss your specific use case and provide a demo of DocIntegrator to illustrate how it can simplify your workflow.