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

Can't access attributes of repeating section with getAttrByName

1459343766

Edited 1459344266
Since the repeating section Roll20 Update, i've got an error with my API scripts when I use the following code : origarmor=getAttrByName(originchar_id, "repeating_armor_$0_ArmorNotes"); "Error: No attribute or sheet field found for character_id -Jo4rw4Mf1ZXtV7emDZV named repeating_armor_$0_ArmorNotes" When i use a macro with @{selected|repeating_armor_$0_ArmorNotes} i get the correct value. Before the Roll20 Update, i used this code and it worked : origarmor=getAttrByName(originchar_id, "repeating_armor_0_ArmorNotes");
1459358175

Edited 1459358213
Phil B.
Forum Champion
Sheet Author
When we reworked the repeating sections it had the downside of making them slightly harder to access, so we added functions for sheetworkers to be able to do it. We forgot to add these same/similar functions to the API. I've documented this and we will look into adding them to the API when we get a chance. In the mean time, you can use something like this,&nbsp; <a href="https://gist.github.com/pjbehr87/63c1fdd9e14ff5b2695827a1d1c1c8e7" rel="nofollow">https://gist.github.com/pjbehr87/63c1fdd9e14ff5b2695827a1d1c1c8e7</a> ,&nbsp;to retrieve all repeating IDs for a section. If you sort the ID's lexographically&nbsp;you can find whatever row you want and retrieve them by "repeating_armor_"+ids[row]+"_AmorNotes".
Thank you for your answer. As i use a lot of these attributes in my script, it would be rather long to modify my script. i will have to wait for the roll20 team to modify these functions in the API.
1459443508
Phil B.
Forum Champion
Sheet Author
Just a warning, it may be a couple of weeks. We are currently in the middle of working on some other things.
A couple of weeks seems good for me. Thank you.