How to upload the data using flow designer

zee15
Tera Contributor

Hi Community,

I'm currently building a process to upload Configuration Items (CIs) into the cmdb_ci table. The requirement is as follows:

  1. A catalog form allows users to upload CI data via an Excel sheet.
  2. Once the request is submitted and approved, the data should be automatically uploaded into the CMDB.

I’ve created a flow in Flow Designer to handle the process, and everything is working fine up to the approval stage. However, I'm facing a challenge with uploading the Excel data into the cmdb_ci table.

Could you please advise:

  1. Is it possible to upload the Excel data into the table directly using Flow Designer?
  2. If yes, then what is the approach to do this using flow?
  3. If not, what would be the best approach to achieve this using scripting (e.g., Script Includes or other server-side logic) so that the data gets uploaded automatically after approval?

Any guidance would be appreciated.

Thanks!

7 REPLIES 7

@zee15 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

swapnali ombale
Kilo Sage

@zee15

Add a condition to check if the attachment has an Excel file extension (.xlsx, .xls). If the condition is met, proceed to the next step; otherwise handle the situation accordingly.

  1. Next, add a "Create Record" action to the flow. Configure the action to create a new record in the ServiceNow cmdb table. Map the relevant fields from the Excel attachment to the corresponding fields in the cmdb table.

  2. Save & Activate flow  

 

zee15
Tera Contributor

Hi,

Thank you for the response.

I was able to achieve the data export functionality without using a script. Here's the approach I followed:

  1. I created a record named "Upload CMDB Data" in the scheduled_import_set table, and set the run condition to "Once."
  2. When we receive the upload request, the flow attaches the Excel file to the associated data source and updates the run_start field in the "Upload CMDB Data" record with the current timestamp.zee15_1-1747910011468.png

     

  3. As soon as this update occurs, the system triggers the scheduled import based on the updated time and processes the data upload.
  4. Once the import is complete, the flow removes the Excel file from the data source to clean up.