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

getAttrByName() Seems to be suffering from inconsistent insistence that certain things be converted to lower case, and other things not be.

1467621965

Edited 1467622040
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
My sheet has a repeating section for general skills              fieldset class="repeating_skills"              Note that this all happens to be lower case. I also have a section for Artistic Skills.                                  fieldset class=repeating_skillA"              This has one capital character. Some code that was working for the first, was not working for the second.  I finally figured out that log( getAttrByName( this.charID, "repeating_skillA_-KLobDO-llFtZkJqZjFH_SKA_Name")); log( getAttrByName( this.charID, "repeating_skilla_-KLobDO-llFtZkJqZjFH_SKA_Name")); log( getAttrByName( this.charID, "repeating_skilla_-KLobDO-llFtZkJqZjFH_ska_name")); gave  "Error: No attribute or sheet field found for character_id -JvAdIYpXgVyt2yd07hv named repeating_skillA_-KLobDO-llFtZkJqZjFH_SKA_Name" undefined "Bone Carving" "Error: No attribute or sheet field found for character_id -JvAdIYpXgVyt2yd07hv named repeating_skilla_-KLobDO-llFtZkJqZjFH_ska_name" undefined Namely, when calling getAttrByName() you MUST lowercase the name of the repeating section, but you CANT lowercase anything else. Only lowercaseing the repeating section name and nothing else avoids the error.  This is inconsistent. It can easily be made to work if it is well documented (which it was not). It would be better if the inconsistancy was not present. 
Hmmm...yeah I'll take a look at that. In theory you should be able to lowercase everything except the Row ID (the "-KLobDO..." part) but it might be that the API isn't handling it properly.