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

Delete a field using sheet workers?

February 03 (7 years ago)
Kryx
Pro
Sheet Author
API Scripter
It's a good practice to limit the number of fields on a sheet. To that end, is it possible to delete a field using sheet workers? I generally set a field to an empty string (''), but would prefer deleting them if that actually removed them. Would null work?
February 03 (7 years ago)
Wouldn't it be possible to listen to if an attribute becomes an empty string to then call the remove function for that attribute?
https://wiki.roll20.net/API:Function_documentation/Roll20_object#remove
February 03 (7 years ago)
Jakob
Sheet Author
API Scripter
I don't think there's any way of deleting attributes via sheet workers. Setting them to null won't work, in fact it will produce an error, since IIRC setAttrs() calls the toString() method on each of the attribute values.
February 03 (7 years ago)
Kryx
Pro
Sheet Author
API Scripter
That's what I thought. Thanks Jakob.

Unfortunate. :(