How can I copy a row's attachements to another row with Bridge?
Answers
-
Don't know about Bridge, but I've done this before using the API.
Here's two functions I wrote to save attachments to a local folder and then upload them to a different row.
import smartsheet import urllib SS = smartsheet.Smartsheet(SMARTSHEET_ACCESS_TOKEN) def save_attachment(attachment_id, sheet_id, local_folder='Attachments'): url = SS.Attachments.get_attachment(sheet_id, attachment_id) urllib.request.urlretrieve(url.url, f".\{local_folder}\{url.name}") def upload_attachment(file_name, local_folder, mime_type, row_id, sheet_id): SS.Attachments.attach_file_to_row(sheet_id, row_id, (file_name, open(f'./{local_folder}/{file_name}', 'rb'), mime_type))
Use will differ based on your needs, but basically you just give it an attachment id and sheet id from your source sheet and row, and then feed it to your target sheet and row.
Here's how I used it:
for a in marcom_row['attachments']: save_attachment(a['id'], plan['sheetId']) upload_attachment(a['name'], 'MarCom Attachments', a['mimeType'], row_id, MARCOM_SHEET_ID) time.sleep(3)
I'm iterating over each attachment in a source sheet, saving it locally, and then uploading it back to a different sheet and row.
-
Adding attachments to a Smartsheet sheet is not directly supported as a module in Bridge.
You may be able to ask your Customer Success Manager or hire a Solutions Consultant to see if they can create a custom module to help you achieve your goals, for example, by using the API like @deepx3 has outlined! (Thank you!)
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
I have created a "New Idea" asking for the creation of an Add Attachment method. Please go up vote. Thanks!
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives