How to get attachment names from one smartsheet to another?
Hi,
I have attachments in rows in one of the Smartsheet. I want those attachment names into another Smartsheet. I want this process to be done automatically. Could someone please help me on this.
Thanks In Advance.
Answers
-
Hi @rye
You can use a workflow to automatically copy rows from one sheet to another; this will copy over the attachments as well. However there currently is no way to use a formula to look at the attachment column and return the names. You may be able to use a third party application or the Smartsheet API to get that data.
Please submit your feature request to the Product team by creating an Idea Post in the Smartsheet Product Feedback and Ideas topic here in the Community.
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Hi Genevieve,
Thank you for your reply. For getting attachment names , I have written a python code to get a list of attachment names in sheet to a local CSV file.
Python Code:
import requests import csv # Replace with your Smartsheet API token and sheet ID token = 'Your API access key' sheet_id = 'Your Sheet ID' # Get the list of attachments for all rows url = f'https://api.smartsheet.com/2.0/sheets/{sheet_id}/attachments' headers = {'Authorization': f'Bearer {token}'} response = requests.get(url, headers=headers) attachments_data = response.json() # List to store attachment names attachment_names = [] # Loop through attachments and collect names for attachment in attachments_data['data']: attachment_name = attachment.get('name') if attachment_name: attachment_names.append(attachment_name) # Write attachment names to the CSV file csv_file_path = 'Local path to your csv files' with open(csv_file_path, 'w', newline='') as csvfile: writer = csv.writer(csvfile) writer.writerow(['Attachment Names']) writer.writerows([[name] for name in attachment_names]) print(f"Attachment names saved to {csv_file_path}")
-
@rye , here is a Smartsheet Community version of the solution we made today.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives