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 values be called from nests

There's a value I have in a fieldset and for some reason I can't call it to a roll that is outside of it. Is there a way to do this? Thanks.
1533257329
Andreas J.
Forum Champion
Sheet Author
Translator
Is it a repeating attribute?
1533266232
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
fieldset values are known as repeating attributes, the full attribute name is repeating_<SectionName>_ID_Attribute_name or repeating_<SectionName>_$X_Attribute_name where X is the row number in the repeating section. The only difference between these is that the ID method will permanently point to the indicated attribute, the $X method will always point to whatever the second row is.
Scott C. said: fieldset values are known as repeating attributes, the full attribute name is repeating_<SectionName>_ID_Attribute_name or repeating_<SectionName>_$X_Attribute_name where X is the row number in the repeating section. The only difference between these is that the ID method will permanently point to the indicated attribute, the $X method will always point to whatever the second row is. Erm... meaning?
1533305351

Edited 1533305371
Finderski
Plus
Sheet Author
Compendium Curator
Grim G. said: Scott C. said: fieldset values are known as repeating attributes, the full attribute name is repeating_<SectionName>_ID_Attribute_name or repeating_<SectionName>_$X_Attribute_name where X is the row number in the repeating section. The only difference between these is that the ID method will permanently point to the indicated attribute, the $X method will always point to whatever the second row is. Erm... meaning? Meaning if you want to call that field outside of it's particular set of fields and it must ALWAYS be a specific one, you need to call it with something like: @{repeating_skills_-Long$tr1inG_Fighting} However, if you only need the one in the first row of the repeating section, you could use: @{repeating_skills_$0_Fighting} If you wanted the one in the second row of the repeating section, you'd use $1 instead of $0 But you do need to reference the full name of the field, which includes the "repeating" and additional stuff...it's not just the name of the field.
1533305938
Finderski
Plus
Sheet Author
Compendium Curator
Finderski said: Meaning if you want to call that field outside of it's particular set of fields and it must ALWAYS be a specific one, you need to call it with something like: @{repeating_skills_-Long$tr1inG_Fighting} The "-Long$tr1inG" is actually unique and automatically generated by Roll20.  To find it, you may need to use the developer tools with Chrome (and I assume Firefox has it) to inspect the element. If you aren't familiar with it, it's located under the menu View => Developer That opens a panel on the right-hand side of the window and if you click the arrow pointing into a box (upper-left-hand corner of the developer's console) you an point to the particular field you want, and that code will highlight on the right. It will look something like this: The long string you'd need is located in the div with the class "repitem." For this particular item, the field would be referenced (outside of the repeating section row) as: @{repeating_item_-LEK-tNrH6EDzSb9uXl9_itemname} Hope this helps.
1533306253

Edited 1533306302
vÍnce
Pro
Sheet Author
Are you wanting to call the value from a macro, or are you wanting to use that value on the sheet to make other calculations for other attributes?  For macros, you would use the method that Scott mentioned ie @{repeating_attack_$X_attack-mod}, where "X" is the row number or if using the rowID which is a better method since it will pull the appropriate value regardless if someone rearranges the rows, @{repeating_attack_ID_attack-mod}.  There are methods to learn the ID of a given row, such as using drag/drop of a row's roll button to the quickbar, making a roll and using the UP arrow in chat.  You can also right-click a repeating row and use the browser's inspect element to view the code directly ie  data-reprowid=" -KjiUOfCaDY8PXanuRhZ "  Some sheet's may even use sheet worker's to generate rowID's so that they can be seen on the sheet. That said, if you need a repeating attribute value to do calcs on the sheet from outside of the fieldset, you'll need to use sheet workers.  Totaling the weight of repeating items from inventory is a common example.  The Arron Sheet (TAS) can be used for this, or create your own method which depends on your experience of javascript.  edit : I should have refreshed sooner.  lol
Finderski said: Grim G. said: Scott C. said: fieldset values are known as repeating attributes, the full attribute name is repeating_<SectionName>_ID_Attribute_name or repeating_<SectionName>_$X_Attribute_name where X is the row number in the repeating section. The only difference between these is that the ID method will permanently point to the indicated attribute, the $X method will always point to whatever the second row is. Erm... meaning? Meaning if you want to call that field outside of it's particular set of fields and it must ALWAYS be a specific one, you need to call it with something like: @{repeating_skills_-Long$tr1inG_Fighting} However, if you only need the one in the first row of the repeating section, you could use: @{repeating_skills_$0_Fighting} If you wanted the one in the second row of the repeating section, you'd use $1 instead of $0 But you do need to reference the full name of the field, which includes the "repeating" and additional stuff...it's not just the name of the field. There's definitely going to be more than just the first row. If the value I'm trying to call is attr_pa_accuracy, would the call be @{repeating_skills_-Long$tr1inG_pa_accuracy} Finderski said: Finderski said: Meaning if you want to call that field outside of it's particular set of fields and it must ALWAYS be a specific one, you need to call it with something like: @{repeating_skills_-Long$tr1inG_Fighting} The "-Long$tr1inG" is actually unique and automatically generated by Roll20.  To find it, you may need to use the developer tools with Chrome (and I assume Firefox has it) to inspect the element. If you aren't familiar with it, it's located under the menu View => Developer That opens a panel on the right-hand side of the window and if you click the arrow pointing into a box (upper-left-hand corner of the developer's console) you an point to the particular field you want, and that code will highlight on the right. It will look something like this: The long string you'd need is located in the div with the class "repitem." For this particular item, the field would be referenced (outside of the repeating section row) as: @{repeating_item_-LEK-tNrH6EDzSb9uXl9_itemname} Hope this helps. Isn't it also possible to access it with F12? And where do I find repitem? I tried Ctrl+Shift+F, but I can't read the results. They look like gibberish. Vince said: Are you wanting to call the value from a macro, or are you wanting to use that value on the sheet to make other calculations for other attributes? Both I think. A roll is a type of macro, yeah? Because I need to add it to a roll and to a number field to show the total modifier. Both are outside of the field. Vince  said: That said, if you need a repeating attribute value to do calcs on the sheet from outside of the fieldset, you'll need to use sheet workers.  Totaling the weight of repeating items from inventory is a common example.  The Arron Sheet (TAS) can be used for this, or create your own method which depends on your experience of javascript.  edit : I should have refreshed sooner.  lol I don't think there's anything in the field set rows that need to be added together, so I don't think I need a sheet worker.
1533397960
vÍnce
Pro
Sheet Author
Calcs done between a fieldset's attributes will work fine without sheet workers, and they can even grab "resolved" values from outside the fieldset.  However, if you need to pull a repeating attribute value in order calculate a value outside of the fieldset, you'll need sheet workers. It's impossible to pull a value for a field/attribute that may not even exist yet.  A sheet worker is needed to check for the existence of the repeating attribute, make an appropriate action and return a proper value to the external attribute.
Vince said: Calcs done between a fieldset's attributes will work fine without sheet workers, and they can even grab "resolved" values from outside the fieldset.  However, if you need to pull a repeating attribute value in order calculate a value outside of the fieldset, you'll need sheet workers. It's impossible to pull a value for a field/attribute that may not even exist yet.  A sheet worker is needed to check for the existence of the repeating attribute, make an appropriate action and return a proper value to the external attribute. So for this to work I will need to use a worker. Which I know nothing about.
1533409300
vÍnce
Pro
Sheet Author
I have very limited js skills, but there are lot's of helpful people here with "uber-skills/knowledge".  Auto-calculating repeating attributes was one of the biggest pushes for sheet workers. Many sheets have this type of calculation on them. Totaling weights of items for encumbrance purposes is a common usage.  If you give an example of what you want to do, I'm sure it can get worked out.
Vince said: I have very limited js skills, but there are lot's of helpful people here with "uber-skills/knowledge".  Auto-calculating repeating attributes was one of the biggest pushes for sheet workers. Many sheets have this type of calculation on them. Totaling weights of items for encumbrance purposes is a common usage.  If you give an example of what you want to do, I'm sure it can get worked out. Well, until someone can answer this thread, I'm just going to have to use a work-around.