Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Add attachments while writing to Smartsheet

JennyRuns24
8 - Asteroid

Hello,

 

I currently have an Alteryx workflow uploading to a Smartsheet. The data being uploaded into Smartsheet comes from a variety of excel files. Is it possible to attach the excel file to Smartsheet during the writing process? If so, can I see some examples?

 

Thank you!

5 REPLIES 5
BrandonB
Alteryx
Alteryx

I'm not sure how your organization has implemented the API calls in the workflow, but you can see here in the smartsheet API documentation that you can attach files: https://smartsheet.redoc.ly/tag/attachments#operation/row-attachments-attachFile 

 

It would appear that you can either link to a file in Dropbox/Box/GoogleDrive/etc, or you can attach the actual file as a binary object. This is the cURL equivalent that they provide as reference

 

curl https://api.smartsheet.com/2.0/sheets/{sheetId}/rows/{rowId}/attachments \
-H "Authorization: Bearer ll352u9jujauoqz4gstvsae05" \
-H "Content-Type: application/msword" \
-H 'Content-Disposition: attachment; filename="ProgressReport.docx"' \
-H "Content-Length: FILE_SIZE" \
-X POST \
--data-binary @ProgressReport.docx

 

Although you may be able to do this via Blob tools and the Download tool, I feel like this might be easiest to do via a Python tool in the workflow and using the snippet that SmartSheet already provides on their site:

 

updated_attachment = smartsheet_client.Attachments.attach_file_to_row(
  9283173393803140,       # sheet_id
  0123456789012345,       # row_id
  ('ProgressReport.docx',
    open('/path/to/ProgressReport.docx', 'rb'),
    'application/msword')
)
JennyRuns24
8 - Asteroid

Thank you very much! This appears to be a little more difficult than I had imagined. Is there a workflow I could use to reference this process?

BrandonB
Alteryx
Alteryx

While there are articles that walk you through how to use APIs in Alteryx, it sounds like your company has possibly built/sourced a custom Smartsheet output tool. Is this the case? 

JennyRuns24
8 - Asteroid

Yes, I do have a Smartsheet output tool available. Is there a way to load the data and the file itself using that?

 

Thank you

manishkatiyar
5 - Atom

@JennyRuns24 are you able to share the Smartsheet output tool with me? I am unable to find any working solution to just write data to smartsheet. My use case is a full overwrite on an existing smartsheet via Alteryx

Labels
Top Solution Authors