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 - Character Sheet - Repeating Fields

Can the API update fields in repeating sections of character sheets? I did some simple tests (not using the API) and I am a bit concerned that this may not work, because it seems if you create the appropriate field it doesn't seem to immediately populate. If you close and reopen the sheet it seems there, but then the attribute itself disappears. Has anyone had success with using the API to update a repeating section?
1406092082
Lithl
Pro
Sheet Author
API Scripter
Repeating attributes are intentionally hidden on that Attributes & Abilities tab. You can search for repeating attributes using the API with the filterObjs function.
1406095115

Edited 1406095151
Sam M.
Pro
Sheet Author
I'm able to read from the field, but I don't think creating one from the API would be the same as creating one from the sheet. Updating works for sure.
1408851056
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Has anyone done much with this for the 5e sheet? Like adding to the repeating section through API?
I did this with my Pathfinder Hero Lab Importer, seems to work well enough.
I'd love any available pointers on this as well. For example, each attribute of each spell on the 5e sheet is stored under its own 'repeating' address. I can manually import using my !setattr script, IF able to accurately predict the next number in the sequence. So a spell in my world looks like this: !setattr --repeating_spellbookcantrip_0_spellname|Acid Splash --repeating_spellbookcantrip_0_spellschool|Conjuration --repeating_spellbookcantrip_0_spellritual| --repeating_spellbookcantrip_0_spellcasttime|1 action --repeating_spellbookcantrip_0_spellrange|60 feet --repeating_spellbookcantrip_0_spellcomponents|V, S --repeating_spellbookcantrip_0_spellduration|Instantaneous --repeating_spellbookcantrip_0_spellconcentration| --repeating_spellbookcantrip_0_spelltypeadvanced|1 --repeating_spellbookcantrip_0_spelldescription|You hurl a bubble of acid. Choose one creature within range, or choose two creatures within range that are within 5 feet of each other. A target must succeed on a Dexterity saving throw or take 1d6 acid damage. This spell's damage increases by 1d6 when you reach 5th level (2d6), 11th level (3d6), and 17th level (4d6). ...and that all works fine, when there's not already a 'cantrip_0'. I can imagine looking up what's there and incrementing by one, that's not a huge deal. Except not all the attributes always exist. So the next available 'repeating_spellbookcantrip_X_spellritual' could well belong to a completely different spell. I suppose I could find a way to determine what's completely free and open and set all spell attributes using that, incrementing when I hit another 'spellname'. Seems ugly. Is there a method for this? :D
My use case when I asked this was quite different, I am not looking to append to anything, instead I have a source file that has everything I needed, so I just looped through the items incrementing along the way. You might be able to loop through looking for a repeating name field and checking the resulting length, if it is greater than 0, increment and try again until you get one where the resulting length is 0. Not sure if this would work or not...