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

Attribute names

Where can I find the attribute name of a field on one of the custom character sheets?  The MSH FASERIP character sheet to be exact.
1656078156
David M.
Pro
API Scripter
I know in Chrome you can right click the field and select "inspect" from the context menu. This will bring up the console log and should highlight the html entity which should include the name somewhere.
1656078546
Kraynic
Pro
Sheet Author
And what you will be looking for in the html is the name property.  name="attr_attributenamehere"
Thanks guys. 
ok so I was able to use the Inspect process to get the field name, this character sheet has the ability to add powers and each of the powers have the same attributes.  So if I want to pull the field value from a specific power how would I write that?  all power have the same field and those fields have the same name, so there has to be a way to say which one I am pointing to.  Can I tell it to field the name field to find a power name and then find that power's rank field?
1656084623
timmaugh
Pro
API Scripter
You're probably looking at a repeating section, then. Think of those like a database or spreadsheet with columns that are the sub-attributes... so every entry on the list gets an ID (a rowID) identifying which row of the list you're trying to access... and then they all have entries for the various columns (sub-attributes): ROWID   | power_name | power_cost | power_attack ===================|================|============|=============== -M1234567890abcdef | Spectral Trout | 3 | 1 -M1234567890abcdf0 | Divine Recusal | 12 | -M1234567890abcdf1 | Wompdiggit | 4 | 3 So, typically you would need to get the appropriate row, and then get the value you want from the appropriate column (the sub-attribute). If you're doing this in the code (ie, you're writing the script yourself), I wrote up a description of the process here . If you just want to do it inline, Fetch offers a way to get data from a repeating attribute by providing certain identifying elements (ie, "get me the power_cost of the entry from this list of spells where the power_name is 'Spectral Trout'"). I think, seeing you post elsewhere, that you're looking to write it in js (a script of your own), so start with the linked thread and see if that makes sense.
timmaugh said: You're probably looking at a repeating section, then. Think of those like a database or spreadsheet with columns that are the sub-attributes... so every entry on the list gets an ID (a rowID) identifying which row of the list you're trying to access... and then they all have entries for the various columns (sub-attributes): ROWID   | power_name | power_cost | power_attack ===================|================|============|=============== -M1234567890abcdef | Spectral Trout | 3 | 1 -M1234567890abcdf0 | Divine Recusal | 12 | -M1234567890abcdf1 | Wompdiggit | 4 | 3 So, typically you would need to get the appropriate row, and then get the value you want from the appropriate column (the sub-attribute). If you're doing this in the code (ie, you're writing the script yourself), I wrote up a description of the process here . If you just want to do it inline, Fetch offers a way to get data from a repeating attribute by providing certain identifying elements (ie, "get me the power_cost of the entry from this list of spells where the power_name is 'Spectral Trout'"). I think, seeing you post elsewhere, that you're looking to write it in js (a script of your own), so start with the linked thread and see if that makes sense. Thanks tim