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?

1517680658
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?
Wouldn't it be possible to listen to if an attribute becomes an empty string to then call the remove function for that attribute? <a href="https://wiki.roll20.net/API:Function_documentation/Roll20_object#remove" rel="nofollow">https://wiki.roll20.net/API:Function_documentation/Roll20_object#remove</a>
1517687450
Jakob
Sheet Author
API Scripter
I don't think there's any way of deleting attributes via sheet workers. Setting them to null &nbsp;won't work, in fact it will produce an error, since IIRC setAttrs() calls the toString() method on each of the attribute values.
1517687589
Kryx
Pro
Sheet Author
API Scripter
That's what I thought. Thanks Jakob. Unfortunate. :(