Skip to content

Smartsheet API implementation to update co-dependent sheets

Notifications You must be signed in to change notification settings

Daan-Haas/smartsheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. Contact

About The Project

This project was written to perform two very specific tasks using the smartsheet API.

  • To poulate a dropdown list with options from a target column
  • to update two co-dependent columns, such as the parts of an engine, and the engines a part can be found in.

Other features may be added later if requested, but for now it performs these two tasks

(back to top)

Getting Started

If your aim is to update a sheet or column regularly, I would recomend setting up the main.py with your column titles and converting it to an executable. in order for this to work i would recomend setting up an environment with the smartsheet-python-sdk and adding the executable to its path.

Prerequisites

in your smartsheet environment install the smartsheet-python-sdk package by typing:

$ pip install smartsheet-python-sdk in your command prompt

If you want to run the project as an executable, also install auto-py-to-exe, using the command:

$ pip install auto-py-to-exe

Setting up

Set main.py

in the main.py file

set the correct name values

workspace = 'Workspace name'
dropdown_sheet = 'Dropdown Sheet Name'
dropdown_col = 'Dropdown column name'

origin_sheet = 'Origin Sheet Name'
origin_col = 'Origin Column Name'
col_type = 'MULTI_PICKLIST'

frst_sheet = 'First Sheet Name'
scnd_sheet = 'Second Sheet Name'
frst_key_col = 'First Search Column'
frst_val_col = 'First Co-dependent Column'
scnd_key_col = 'Second Search Column'
scnd_val_col = 'Second Co-dependent Column'

Installation

convert your .py file to an exe, for an example how to do this visit: https://pypi.org/project/auto-py-to-exe/

(back to top)

Usage

After this, using the project is as simple as clicking on the executable!

The first time it will ask you to enter your API key.

From the smartsheet home screen, access your account, and click on Apps & Integrations...

image

Here an API key can be generated by selecting 'API Access' and clicking on 'Generate new access token'

image

Be aware, you may need owner or admin rights for the sheets you wish to edit

Paste this key into the terminal and press enter.

The program will ask you to renew your API key once every week.

(back to top)

Considerations

Some things worth noting when using this program:

Cell permissions

The make_dropdown function right now only fills the options and sets the column type. It does not change other settings of the column, these features could be added upon request.

The same applies to the compare_dict function. In this case, the smartsheet option 'Restrict to list values only' option might cause trouble, when trying to write an option that is not in the list.

Removing values

The make_dropdown function makes a new options list anytime it is run, meaning if values are removed from the origin column, they will also be removed from the dropdown picklist.

The compare_dict function appends new values to the cell. this means it does not have the ability to remove values from cells. this means that if you have a value that needs to be removed, it will need to be removed from both sheets. If there is need for a function that can remove values from a picklist cell, please open an issue of for the repo if you want to contribute.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

Daan van Haastern - dagvanhaasteren@gmail.com

Project Link: https://github.com/Daan-Haas/smartsheet

(back to top)

About

Smartsheet API implementation to update co-dependent sheets

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages