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

How modify a repeating section from the outside ?

1473891721

Edited 1473891887
Alain H.
Pro
Sheet Author
API Scripter
Hi, I try to modify a row in a repeating section from the outside with sheet worker, without know the ID of that row. Is it possible ? Sorry for my english, thanks in advance
1473915086
Lithl
Pro
Sheet Author
API Scripter
getSectionIDs('repeating_my-repeating-section-name', function(idarray) { // `idarray` is an array of the id for each row in the repeating section // You can then get a specific attribute from a specific row with // getAttrs(['repeating_my-repeating-section-name_' + idarray[i] + '_my-attribute-name'], function(values) { ... }); });
1473930626

Edited 1473930659
Alain H.
Pro
Sheet Author
API Scripter
I've already see that, but how modify an repeating section with that ? I can read with that but for example can I do that : on("change:cogBase", function() {        getSectionIDs("repeating_comp", function(idarray) {           for(var i=0; i < idarray.length; i++) {              var ID = idarray[i];                           getAttrs([                 "repeating_comp_"+ID+"_compAptScoreSelectcompAptScoreSelect",                 "repeating_comp_"+ID+"_compAptScoreShow",                 "cogBase"                 ], function(values){                                 var cog = parseInt(values["cogBase"]);                                          setAttrs({                                 repeating_comp_ID_compAptScoreShow:cog                             });             });                        }        });     }); ?