How do I import a service catalog item's attached spreadsheet into its multi row variable set?

mike275
Mega Expert

I have a service catalog item with an MVRS with a few fields.  I have a link on the page to a spreadsheet template I want to allow users to fill out and upload to populate the MVRS.

Can I do this?

1 ACCEPTED SOLUTION

mike275
Mega Expert

It's possible - I did it like so:

 

  1. Create a workflow script task that
  2. If an attachment exists for the SC item, I create an Excel attachment datasource
  3. Copy the attachment from the SC item to the Excel data source
  4. Import from the data source created in #3 into an Import Set
  5. Query the Import Set table and read the imported rows, converting them into Javascript objects and pushing them onto an array
  6. Set the MVRS value to the JSON.stringify(...) value of the array created in step 5

 

I do data validation and all that, and add comments in the task if rows in the spreadsheet contain invalid data.

View solution in original post

5 REPLIES 5