Hi @mortonj
The Python code will add rows with a CONTACT_LIST column cell and a Multiple_CONTACT_LIST column cell if the sheet specified by sheet_id has such columns. (The code uses smartsheet-python-sdk.)
https://us.v-cdn.net/6031209/uploads/RXAMD6SVE4IW/image.png
pip install smartsheet-python-sdk
import smartsheet access_token = 'your access token' smartsheet_client = smartsheet.Smartsheet(access_token) sheet_id = 1234567890123456 sheet = smartsheet_client.Sheets.get_sheet(sheet_id) contact_list_column_id = next((column.id for column in sheet.columns if column.type == "CONTACT_LIST"), None) multiple_contacts_column_id = next((column.id for column in sheet.columns if column.version == 1), None) members = [ {"name": "Jane Doe", "email": "jane.doe@sample.com"}, {"name": "John Doe", "email": "john.doe@sample.com"}, {"name": "John Smith", "email": "john.smith@sample.com"}, {"name": "Jane Smith", "email": "jane.smith@sample.com"}, ] rows_to_add = [] multi_contacts = [] for member in members: new_row = smartsheet.models.Row() if contact_list_column_id: contact_cell = smartsheet_client.models.Cell() contact_cell.column_id = contact_list_column_id member['objectType'] = 'CONTACT' contact_cell.object_value = member new_row.cells.append(contact_cell) if multiple_contacts_column_id: multi_contacts.append(member) multiple_contact_cell = smartsheet_client.models.Cell() multiple_contact_cell.column_id = multiple_contacts_column_id multiple_contact_cell.object_value = {"objectType": "MULTI_CONTACT", "values": multi_contacts} new_row.cells.append(multiple_contact_cell) if contact_cell or multiple_contact_cell: rows_to_add.append(new_row) if len(rows_to_add) > 0: # Add rows to sheet response = smartsheet_client.Sheets.add_rows( sheet_id, # sheet_id rows_to_add)
Contact list in Smartsheet after importing data
I am running into an issue where I import a group of names assigned to a certain task in Smartsheet. The list of names comes from an excel spreadsheet as multiple agencies must provide their inputs and not all have Smartsheet access (the Smartsheet in question is only for my agency's use). Well after importing the updated list (weekly) to my Smartsheet, the data automatically converts to a dropdown list. I then have to manually go in and convert it to a contact list and put the contacts back in individual cells. This process takes unneeded time out of my Monday. Is there a simpler way to have that list import to those columns and the contact stays in place?
Best Answer
-
Hi @JGarcia0703
You're facing a common challenge when importing contact data into Smartsheet. Since your list comes from Excel and Smartsheet does not automatically recognize names as contacts upon import, there are a few potential solutions.
Option 1: Use Data Shuttle to Update the Contact List (Requires Smartsheet Advance Plan)
- How It Works: You can configure Data Shuttle to update the contact column from your Excel file automatically.
- Pros:
- Automates the process, reducing manual effort.
- You can keep your list updated weekly without intervention.
- Cons:
- If full names are imported as text, Smartsheet will not treat them as contacts.
- Only email addresses will function correctly in a contact list.
- Requires a Smartsheet Advance Plan (not available in all accounts).
The image below is part of the Data Shuttle workflow that updates the contact list with email text.
Option 2: Import Excel Data and Manually Convert to Contacts
- How It Works: You can format names in your Excel file as
Jane Doe <jane.doe@somecompany.com>
, then import the file and manually convert the column to a Contact List column. - Pros:
- No need for additional Smartsheet tools (like Data Shuttle).
- Provides both the name and email address.
- Cons:
- Requires a manual step each time after import to convert text into contacts.
- Still time-consuming on a weekly basis.
This link is my post on this method.
https://community.smartsheet.com/discussion/comment/369125
I put this demo dashboard to illustrate this method somewhere in 2023.
Option 3: Use the Smartsheet API to Update Contacts Automatically
- How It Works: You can use the Smartsheet API to programmatically update the column and ensure names are correctly formatted as contacts. This script could be triggered automatically when your list is updated.
- Pros:
- Fully automates the process.
- Ensures that names display correctly and function as contacts (for @mentions, update requests, etc.).
- Cons:
- Requires development work to implement an API script.
- Needs API access and permissions.
The code explained in the comment below does not update the contact list option. It adds contact value using the name and email information.
Best Approach Based on Your Needs
- If you have access to Data Shuttle, this could be a good option for automating updates. However, email-only imports may limit usability.
- If you don’t have Data Shuttle, importing an Excel file with properly formatted data (
Name <email>
) and manually converting to contacts is an easy workaround. - If your team has API capabilities, using the Smartsheet API is the best long-term, fully automated solution.
Would you like help with an API script to automate this process? Let me know what works best for you!
Answers
-
Hi @JGarcia0703
You're facing a common challenge when importing contact data into Smartsheet. Since your list comes from Excel and Smartsheet does not automatically recognize names as contacts upon import, there are a few potential solutions.
Option 1: Use Data Shuttle to Update the Contact List (Requires Smartsheet Advance Plan)
- How It Works: You can configure Data Shuttle to update the contact column from your Excel file automatically.
- Pros:
- Automates the process, reducing manual effort.
- You can keep your list updated weekly without intervention.
- Cons:
- If full names are imported as text, Smartsheet will not treat them as contacts.
- Only email addresses will function correctly in a contact list.
- Requires a Smartsheet Advance Plan (not available in all accounts).
The image below is part of the Data Shuttle workflow that updates the contact list with email text.
Option 2: Import Excel Data and Manually Convert to Contacts
- How It Works: You can format names in your Excel file as
Jane Doe <jane.doe@somecompany.com>
, then import the file and manually convert the column to a Contact List column. - Pros:
- No need for additional Smartsheet tools (like Data Shuttle).
- Provides both the name and email address.
- Cons:
- Requires a manual step each time after import to convert text into contacts.
- Still time-consuming on a weekly basis.
This link is my post on this method.
https://community.smartsheet.com/discussion/comment/369125
I put this demo dashboard to illustrate this method somewhere in 2023.
Option 3: Use the Smartsheet API to Update Contacts Automatically
- How It Works: You can use the Smartsheet API to programmatically update the column and ensure names are correctly formatted as contacts. This script could be triggered automatically when your list is updated.
- Pros:
- Fully automates the process.
- Ensures that names display correctly and function as contacts (for @mentions, update requests, etc.).
- Cons:
- Requires development work to implement an API script.
- Needs API access and permissions.
The code explained in the comment below does not update the contact list option. It adds contact value using the name and email information.
Best Approach Based on Your Needs
- If you have access to Data Shuttle, this could be a good option for automating updates. However, email-only imports may limit usability.
- If you don’t have Data Shuttle, importing an Excel file with properly formatted data (
Name <email>
) and manually converting to contacts is an easy workaround. - If your team has API capabilities, using the Smartsheet API is the best long-term, fully automated solution.
Would you like help with an API script to automate this process? Let me know what works best for you!
-
Thank you @jmyzk_cloudsmart_jp
I might need help with the API if I have the capabilities. I will check soon and let you know! -
Happy to help! Let me know once you've checked.😁
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.1K Get Help
- 430 Global Discussions
- 149 Industry Talk
- 489 Announcements
- 5.2K Ideas & Feature Requests
- 85 Brandfolder
- 154 Just for fun
- 74 Community Job Board
- 499 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 305 Events
- 36 Webinars
- 7.3K Forum Archives