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

API command to create a new repeating section item?

Pretty sure I saw something about this here once. CharSetAttr works great as long as there's already an item in that repeating field. Is there something that will create it?
1535578587
The Aaron
Pro
API Scripter
Hmm.  Probably a limitation of being able to know that a repeating section exists from the API.  It might have to "take it on faith" that it exists if you tell it to create one that doesn't already exist, or possibly be changed to look for any attribute in that group (across characters) got use as a template for creating the necessary attributes. I've not looked at how Jakob does that, but that's my guess.  Maybe he can come up with a clever way to fix that. 
Yeah, I think it's gotta exist in some form before it can be modified with that script. Like I said, once I create a new weapon (for example) and fill in any of the fields manually, it works just fine. But if there's not a repeating item in place already, ChatSetAttr just doesn't work. Hoping someone had a solution.
ChatSetAttr used  to create new repeating fields. Is that not the case anymore? This exerpt is taken from the one-click documentation for ChatSetAttr. If you want to create a new repeating row in a repeating section with name   prefix , use the attribute name   repeating_prefix_-CREATE_name .
Kyle I must have missed that part... I'll check it out later after work. Thanks!
1535587918
GiGs
Pro
Sheet Author
API Scripter
Yes, I use this feature pretty regularly, ChatSetAttr will create repeating fields as needed. I dont remember needing to use the CREATE syntax, but I'm probably misremembering - I'd need to check my macros which I havent edited in months.
1535613703
Jakob
Sheet Author
API Scripter
Yeah, what everyone said, using -create for the section id should work, if it doesn't, please say so.
Works perfectly Jakob, thanks everyone!