Hello,
This post provides a solution for quickly adding cross sheet references to a large number of sheets. The cross sheet reference refers to a single column.
Caution
The API code can update any sheet where you have permission to create cross sheet references. There is no way to automatically remove or edit cross sheet references. To be really safe, create a temporary user that only has access to the sheets you want to update. Create an API access token for that user. Using the temporary user lowers the risk of accidentally creating unintended cross sheet references.
My se case
I needed to add a cross sheet reference to a specific sheet in every project connected to a Control Center blue print. There were a large number of projects and sheets and manually creating the cross sheet references would have taken a lot of time.
To use the cross sheet references after I created them, I ran a Global Update across all projects to update a formula in the sheets and added the new cross sheet reference to the formula.
What you need
Consult an AI to detail how to do each step.
- Python.
- Visual Studio Code.
- You could run it other ways but I used this.
- String you want to search for in the name of the sheets.
- NB - This searches ALL sheets visible to the user whose token you use.
- ID of the the source sheet for the cross sheet reference.
- ID of the source column on the source sheet for the cross sheet reference.
- This code only references a single column.
Code
#Creates Smartsheet Cross Sheet References
#There is API method to edit or delete cross sheet references
#Removing the cross sheet references is manual work so use this code carefully
#By Neil Egsgard, Business Solutions Architect, SAIT
#Created Sep 19, 2025
import smartsheet
#Token to allow API Smartsheet access. Do not share this token!
ACCESS_TOKEN = 'YOUR ACCESS TOKEN'
smartsheet_client = smartsheet.Smartsheet(ACCESS_TOKEN)
#Variables you need to edit
SOURCE_SHEET_ID = YourSheetID
SOURCE_COLUMN_ID = YourColumnID
NAME_FILTER = "STRING IN SHEET NAME YOU WANT TO LOOK FOR"
CROSS_SHEET_REFERENCE_NAME = "NAME YOU WANT FOR THE CROSS SHEET REFERENCE"
#Defines a function that will get the list of sheets that have a string match in the name
def get_matching_sheets(name_filter):
matching_sheets = []
response = smartsheet_client.Sheets.list_sheets(include_all=True)
for sheet in response.result:
if name_filter.lower() in sheet.name.lower():
matching_sheets.append(sheet)
return matching_sheets
#Defines a function that will create the cross sheet reference
def create_cross_sheet_reference(target_sheet_id, source_sheet_id, column_id):
xref = smartsheet.models.CrossSheetReference({
'name': CROSS_SHEET_REFERENCE_NAME,
'source_sheet_id': source_sheet_id,
'start_column_id': column_id,
'end_column_id': column_id
})
result = smartsheet_client.Sheets.create_cross_sheet_reference(target_sheet_id, xref)
return result
# Get matching sheets
target_sheets = get_matching_sheets(NAME_FILTER)
# Create references for all matching sheets
for sheet in target_sheets:
print(f"Creating reference in sheet: {sheet.name}")
try:
response = create_cross_sheet_reference(sheet.id, SOURCE_SHEET_ID, SOURCE_COLUMN_ID)
print(f"✅ Success: Reference created in '{sheet.name}'")
except Exception as e:
print(f"❌ Failure: Could not create reference in '{sheet.name}' — {e}")
I hope this helps.
Neil Egsgard
Business Solutions Architect
Southern Alberta Institute of Technology