Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Importing values to custom sheet

September 08 (3 years ago)
borings b.
Pro
Marketplace Creator

Sorry if this has been asked before, i couldn't see anything particularly relevant already in the forums. If i have a custom sheet with empty values, like lets say all the core stats are just named fields, is there a way to import values to fill out that sheet? i have a separate website where the values are being kept, and i could have that website create the script to enter the values dynamically, but i can't really figure out where i would have players input the generated script to have their stat values imported, or if that is even possible.

September 08 (3 years ago)
vÍnce
Pro
Sheet Author

An API script could be written to handle this off-sheet, or perhaps done on-sheet internally using a textbox field for input and sheetworker to process.  Export from your external location as a json, paste into the sheet, then use sheetworkers to parse the json (basically, match json key to a sheet attribute and set the attribute to the json value).  Easy-peasy.  I'm not qualified to actually demonstrate how to do this in js/sheetworker though. ;-(  But, perhaps someone else might be able to post an example...

September 08 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

You might be able to do it without a script, by having your website write a bunch of command lines for chatSetAttr, a script that lets you edit and create attributes for a character.

September 08 (3 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Here are some examples of using this technique to write custom class features on the Shaped Sheet and custom Equipment on the OGL sheet.

September 09 (3 years ago)
Finderski
Pro
Sheet Author
Compendium Curator

You also export the data in JSON format, and set up a field on the sheet where you paste the JSON (or any structured format, really) and have a sheet worker parse the data. 

September 09 (3 years ago)
borings b.
Pro
Marketplace Creator

thanks yall, that was really helpful!