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

[Question] Using sheet workers to migrate attribute data

1483438035

Edited 1483438947
vÍnce
Pro
Sheet Author
I believe this needs some sheet worker magic, but I'm open to any suggestions. Problem: Change an existing selector field into a text input field.  The value of weapon1-quality  will need to be converted from a numerical value to it's corresponding word/text as used within the selector. Finally, update the value of  weapon1-quality  with the converted word/text.  Pipe dream?   Or, it would also be fine if the converted value of  weapon1-quality  was placed into another attribute, say weapon1-quality-text , if that would make it easier... example of exisitng input <select name="attr_weapon1-quality">     <option value="0" selected> </option>     <option value="1">Balanced</option>     <option value="2">Blunt</option> </select>
1483447320
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
What would be cool...... &nbsp;is you had something like this:&nbsp; <a href="https://app.roll20.net/forum/post/4436743/anyone-p" rel="nofollow">https://app.roll20.net/forum/post/4436743/anyone-p</a>... Then you could include in the sheet a local migration sheetworker API script module. "!updateversion" in the&nbsp;pseudo API input field and hit enter. Just saying.
1483466603
vÍnce
Pro
Sheet Author
You are not helping Stephen...
1483467434
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I think it would take new input fields. And a conversion array. script would look for the current value in the existing select boxes and use that to pull from the array the right text vaue. With that value known... update the new field. What sheet is this for?
1483467652

Edited 1483467750
Lithl
Pro
Sheet Author
API Scripter
Yes, a sheet worker update script is exactly what this needs. You basically need some way to determine if the sheet needs updating, and a way to not &nbsp;update the same sheet twice. The Exalted 3e sheet has a fairly extensive upgrade script, including renaming attributes and turning a fixed set of fields into repeating sections, you can look at. Here's the upgrade entry point: on('sheet:opened', TAS._fn(function upgradeVersion(e) { TAS.debug('Checking version', e); getAttrs(['version', 'exalt-type'], TAS._fn(function versionCheck(values) { var v = parseFloat(values.version); if (v !== version) { switch (v) { default: if (values['exalt-type'] && values['exalt-type'].length &gt; 0) { // version 1 upgradeV1toV2(); } else { // new character } } } })); })); In v1 of the sheet, there was an exalt-type selector, but v2 doesn't. The version attribute is only set by the sheet worker (it doesn't exist as an input on the sheet). Therefore, any character with no version is either a brand new character, or needs upgrading from a version without the sheet worker. Any character with a value for exalt-type must be from v1. (And upgradeV1toV2 sets all of the no-longer-used attributes on the sheet to an empty string.)
1483470388
vÍnce
Pro
Sheet Author
@Stephen I've been moonlighting ;-) ...&nbsp; Symbaroum is the system/sheet (TL;DR: dark medieval fantasy setting with a loose, narrative style and low crunch). Thanks Brian. &nbsp;I have "stolen" a similar version checking routine from Chris (don't tell him) in the past for another sheet where I needed to swap two attributes. &nbsp;I'll have a look at your Exalted sheet and see if I can make heads/tales of your code. And Brian...I have no idea what most of what you put means. I am self-taught, and my teacher sucked. - Coal Powered Puppet
1483471628
Finderski
Pro
Sheet Author
Compendium Curator
Vince, I'm in that boat with you, and love that CPP quote... :)
1483568253
vÍnce
Pro
Sheet Author
Ok, I've started the process of cobbling together something that will let me convert a number to a word. &nbsp;I'm stuck on an error " Uncaught TypeError: Cannot read property 'substring' of undefined" I can give the complete script if needed... but I believe this is the code causing the error. getAttrs(["repeating_weapons:weapon1-quality"], function(values) { console.log(".........Current Value for repeating weapon1-quality = "+ (parseInt(values["repeating_weapons_weapon1-quality"],10)) ); var qualityName; if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 0){qualityName=""} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 1){qualityName="Balanced"} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 2){qualityName="Blunt"} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 3){qualityName="Deep Impact"} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 4){qualityName="Jointed"} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 5){qualityName="Long"} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 6){qualityName="Precise"} if ((parseInt(values["repeating_weapons_weapon1-quality"],10)) === 7){qualityName="Short"} console.log("....Current Text Value for repeating weapon1-quality = "+ qualityName ); }); You can quit laughing now. ;-) &nbsp; Any suggestion/help appreciated. &nbsp;Thanks
1483568962
Kryx
Pro
Sheet Author
API Scripter
there is no&nbsp;substring in that code - the error comes from some other point of code.
1483568995
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
getAttrs(["repeating_weapons:weapon1-quality"], function(values) { var qualityName, list=["", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], index; index = ~~values["repeating_weapons_weapon1-quality"]; qualityName = list[index]; console.log("....Index:" + index + ", given:" + values["repeating_weapons_weapon1-quality"] + ", name:" + qualityName); });
1483569053

Edited 1483569067
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
That code I just posted likely wont work to Kryx's point.... but that is a leaner approach.&nbsp;
1483570738
vÍnce
Pro
Sheet Author
Thanks Kryx. &nbsp;I'll have a look at the rest of the script. &nbsp; @Stephen. &nbsp;Can I assume that's an "array"? &nbsp;I've heard of those things... &nbsp;Thanks
1483646346
vÍnce
Pro
Sheet Author
OK &nbsp;I'm clueless. &nbsp;Still getting the error " Uncaught TypeError: Cannot read property 'substring' of undefined" but&nbsp;can't figure out why. Here's my entire sheet worker script (stolen/borrowed/cobbled, but currently broken). &nbsp;Well actually it does set the version properly. Any suggestions appreciated. &nbsp;Thanks &lt;script type="text/worker"&gt; var Sheet = Sheet || (function(){ &nbsp; &nbsp; var version= 0.1, &nbsp; &nbsp; Debug = false, &nbsp; &nbsp; // convert weapon quality selector from numeric value to text &nbsp; &nbsp; qualitySwap = function() { // get weapon quality text values &nbsp; &nbsp; &nbsp; &nbsp; getAttrs(["weapon1-quality"], function(values) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var qualityName,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list=["", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index = ~~values["weapon1-quality"]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; qualityName = list[index]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log("....Index:" + index + ", given:" + values["weapon1-quality"] + ", name:" + qualityName); &nbsp; &nbsp; &nbsp; &nbsp; }); // get repeating weapon quality text values &nbsp; &nbsp; &nbsp; &nbsp; getAttrs(["repeating_weapons:weapon1-quality"], function(values) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var qualityName,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; list=["", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index = ~~values["repeating_weapons_weapon1-quality"]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; qualityName = list[index]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log("....Index:" + index + ", given:" + values["repeating_weapons_weapon1-quality"] + ", name:" + qualityName); &nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp;&nbsp; /* recalculateSheet */ &nbsp; &nbsp; recalculateSheet = function(oldversion) { &nbsp; &nbsp; &nbsp; &nbsp; if (oldversion &lt; 0.1) { //call your functions here &nbsp; &nbsp; &nbsp; &nbsp; qualitySwap(); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }, &nbsp; &nbsp;&nbsp; /* checkForUpdate looks at current version of page in &nbsp;* sheet_version and compares to code Sheet.version calls &nbsp;* recalulateSheet if versions don't match or if recalculate &nbsp;* button was pressed. */ &nbsp; &nbsp; checkForUpdate = function() { &nbsp; &nbsp; &nbsp; &nbsp; getAttrs(["sheet_version","sheet_forcesync","recalc1"],function(v){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var setter={},currVer=0,setAny=0,recalc=false; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currVer=parseFloat(v["sheet_version"],10)||0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log("Current sheet data version:"+currVer+", Sheet code version:" + version );&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( currVer!== version ) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; recalc=true; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setter["sheet_version"]= version; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setAny=1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (v["recalc1"] && v["recalc1"]!="0" ) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currVer=-1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; recalc=true; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setter["recalc1"]=0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setAny=1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (v["sheet_forcesync"] && v["sheet_forcesync"]!="0" ) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currVer=-1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; recalc=true; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setter["sheet_forcesync"]=0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setAny=1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (setAny) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setAttrs( setter); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (recalc) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; recalculateSheet(currVer); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; }; &nbsp; &nbsp; return { &nbsp; &nbsp; &nbsp; &nbsp; version:version, &nbsp; &nbsp; &nbsp; &nbsp; checkForUpdate:checkForUpdate, &nbsp; &nbsp; &nbsp; &nbsp; qualitySwap:qualitySwap &nbsp; &nbsp; }; }()); //sheet on("sheet:opened",function(){Sheet.checkForUpdate();}); on("change:recalc1",function(){Sheet.checkForUpdate();}); &lt;/script&gt; ...
1483646536
Kryx
Pro
Sheet Author
API Scripter
There is still no substring in that code so the error is likely not coming from your code. Can you take a screenshot of the error you see? including the location it appears (on the right side in chrome dev tools)
1483647673

Edited 1483647735
vÍnce
Pro
Sheet Author
Absolutely.
1483651631
Kryx
Pro
Sheet Author
API Scripter
That error comes from app.js which is roll20's code. Nothing you can fix about it.
1483653860

Edited 1483696281
vÍnce
Pro
Sheet Author
Thanks Kryx. &nbsp;I guess that's good and bad. &nbsp;;-)
1483696219
vÍnce
Pro
Sheet Author
Got rid of the weird substring error and I'm getting closer... I believe that I need to use getSectionIDs to make an array of the repeating id's that can be used to get the proper repeating attribute data. Here's the section of code that isn't giving me my intended output. // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(idarray) { for(var i=0; i &lt; idarray.length; i++) { console.log("....row id " + i ); getAttrs(["repeating_weapons_" + idarray[i] + "_weapon1-quality"], function(values) { var qualityName,&nbsp; list=["", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], index; index = ~~values["repeating_weapons_" + idarray[i] + "_weapon1-quality"]; qualityName = list[index]; console.log("....Index:" + index + ", given:" + values["repeating_weapons_" + idarray[i] + "_weapon1-quality"] + ", name:" + qualityName); }); } }); Console log: Console log: Current sheet data version:0.1, Sheet code version:0.1 VM30:16 ....Index:1, given:1, name:Balanced VM30:21 ....row id 0 VM30:21 ....row id 1 2VM30:29 ....Index:0, given:undefined, name: I would expect for the 2 repeating weapons to be listed like&nbsp; VM30:16 ....Index:1, given:1, name:Balanced Please keep throwing me bones. ;-)
1483708517
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
VM30:16 ....Index:1, given:1, name:Balanced 0 1 2 3 4 5 6 7 list=["", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"] That looks right.....&nbsp; 2VM30:29 ....Index:0, given:undefined, name: That also looks right .... but not what you want. Given =&nbsp;values["repeating_weapons_" + idarray[i] + "_weapon1-quality"] That happens to be undefined .... you might have weapon there but you never set the weapon quality.. index = ~~ values["repeating_weapons_" + idarray[i] + "_weapon1-quality"]; That "~~" bitwise operator will convert what it is given to whatever number it represents... in this case you gave it &nbsp; undefined . ~~undefined = 0; qualityName = list[index]; So in this case "".... since Given = undfined and Index = ~~Given..... "" is at the "0" spot on the list. So...... 2VM30:29 ....Index:0, given:undefined, name: Makes sense since&nbsp; Given = undefined;
1483721488
chris b.
Pro
Sheet Author
API Scripter
YOU ARE WORKING ON SOMEONE ELSE'S SHEET!???&nbsp;
1483721657

Edited 1483975988
chris b.
Pro
Sheet Author
API Scripter
Kryx said: That error comes from app.js which is roll20's code. Nothing you can fix about it. we managed to get the Pathfinder sheet down from 7 of those messages on sheet-open, to 2, so apparently we did something - probably it was a change to HTML. but .. who knows what it was, because it's almost impossible to track down and debug since it's buried in their code. unless .. i don't want to put a breakpoint there but is there way in chrome we can make it stop and debug once it hits that error? maybe we can find the variable name (edit: changed "there" to "their".. so ashamed...)
1483727752
vÍnce
Pro
Sheet Author
chris b. said: YOU ARE WORKING ON SOMEONE ELSE'S SHEET!???&nbsp; uhhh. It just happened.... ;-)
1483728188

Edited 1483728224
Finderski
Pro
Sheet Author
Compendium Curator
Vince said: chris b. said: YOU ARE WORKING ON SOMEONE ELSE'S SHEET!???&nbsp; uhhh. It just happened.... ;-) Chris, if it makes you feel any better I tried getting him to work on someone else's before, but he managed to shove it off onto me instead....I'm still not certain how that happened... :-/ Oh, and sorry, Vince, I got nothing useful for you... :(
1483731583
vÍnce
Pro
Sheet Author
Stephen S. said: VM30:16 ....Index:1, given:1, name:Balanced 0 1 2 3 4 5 6 7 list=["", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"] That looks right.....&nbsp; 2VM30:29 ....Index:0, given:undefined, name: That also looks right .... but not what you want. Given =&nbsp;values["repeating_weapons_" + idarray[i] + "_weapon1-quality"] That happens to be undefined .... you might have weapon there but you never set the weapon quality.. index = ~~ values["repeating_weapons_" + idarray[i] + "_weapon1-quality"]; That "~~" bitwise operator will convert what it is given to whatever number it represents... in this case you gave it &nbsp; undefined . ~~undefined = 0; qualityName = list[index]; So in this case "".... since Given = undfined and Index = ~~Given..... "" is at the "0" spot on the list. So...... 2VM30:29 ....Index:0, given:undefined, name: Makes sense since&nbsp; Given = undefined; Thanks for helping with this. &nbsp;If I understand this, for some reason(to be determined) the repeating attribute weapon1-quality is not being defined. &nbsp; ie = " " &nbsp;as stated in &nbsp;list=["", "Bal... This is strange since both repeating weapons do have values for quality. &nbsp;5, and 6 respectively. &nbsp; I inserted a debugger; to try and figure out what's going on. (perhaps I am learning a modecom of js thru this... maybe not.) (I hope this screencap is large enough to read. &nbsp;in edit it looks too small... damn it.) &nbsp; The important part of the log seems to be &nbsp; values = Object {repeating_weapons_-kzf13o-hvdr38wlni4n_weapon1-quality: "5"} So it looks like we are fine up to that point, but something isn't right with the array...? "I'd like to buy a vowel."
1483731735
vÍnce
Pro
Sheet Author
Finderski said: Vince said: chris b. said: YOU ARE WORKING ON SOMEONE ELSE'S SHEET!???&nbsp; uhhh. It just happened.... ;-) Chris, if it makes you feel any better I tried getting him to work on someone else's before, but he managed to shove it off onto me instead....I'm still not certain how that happened... :-/ Oh, and sorry, Vince, I got nothing useful for you... :( "Kick 'em when they're up Kick 'em when they're down Kick 'em when they're up Kick 'em when they're down Kick 'em when they're up Kick 'em when they're down Kick 'em when they're up Kick 'em all around"... lol
1483732875
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Take in chapters..... first // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(idarray) { for(var i=0; i &lt; idarray.length; i++) { console.log("....row id " + i ); } }); Then this.... // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(idarray) { for(var i=0; i &lt; idarray.length; i++) { console.log("....row id " + i ); getAttrs(["repeating_weapons_" + idarray[i] + "_weapon1-quality"], function(values) { var given = values["repeating_weapons_" + idarray[i] + "_weapon1-quality"]; console.log("....row id " + i ); console.log("....Given:" + values["repeating_weapons_" + idarray[i] + "_weapon1-quality"]); }); } }); Then this.... // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(idarray) { for(var i=0; i &lt; idarray.length; i++) { console.log("....row id " + i ); getAttrs(["repeating_weapons_" + idarray[i] + "_weapon1-quality"], function(values) { var given = values["repeating_weapons_" + idarray[i] + "_weapon1-quality"], index = ~~given;&nbsp; console.log("....row id " + i ); console.log("....Given:" + values["repeating_weapons_" + idarray[i] + "_weapon1-quality"] ); console.log("....Index:" + index ); }); } }); Then this.... // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(idarray) { for(var i=0; i &lt; idarray.length; i++) { console.log("....row id " + i ); getAttrs(["repeating_weapons_" + idarray[i] + "_weapon1-quality"], function(values) { var given = values["repeating_weapons_" + idarray[i] + "_weapon1-quality"], index = ~~given; list = [ "unknown" , "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], qualityName = list[index]; console.log("....row id " + i ); console.log("....Given:" + values["repeating_weapons_" + idarray[i] + "_weapon1-quality"] ); console.log("....Index:" + index ); console.log("....row id " + i ); console.log("....Given:" + values["repeating_weapons_" + idarray[i] + "_weapon1-quality"] ); console.log("....QualityName:" + qualityName ); }); } });
1483787712

Edited 1483787756
vÍnce
Pro
Sheet Author
This is starting to become painful. (3am...) The top non-repeating section seems to be functioning as expected, but the next thread(repeating) is still showing " Given: undefined " My current " difficult " section of code(slightly updated from above) // get weapon quality text values getAttrs(["weapon1-quality"], function(values) { var qualityName,&nbsp; list=["None", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], index = ~~values["weapon1-quality"]; qualityName = list[index]; console.log("....Given: " + values["weapon1-quality"] ); console.log("....Index: " + index ); console.log("....QualityName: " + qualityName ); }); // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(idarray) { for(var i=0; i &lt; idarray.length; i++) { console.log("....Row id " + idarray[i] ); getAttrs(["repeating_weapons_" + idarray[i] + "_weapon1-quality"], function(values) { var qualityName,&nbsp; list=["None", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], index = ~~values["weapon1-quality"]; qualityName = list[index]; console.log("....Row id " + i ); console.log("....Given: " + values["weapon1-quality"] ); console.log("....Index: " + index ); console.log("....QualityName: " + qualityName ); }); } }); console log Why is given still undefined? &nbsp;I read where having the&nbsp; getAttrs inside the for loop was problematic. &nbsp; Is that my problem? &nbsp;I mean one of my problems? &nbsp;;-P
1483789904
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Why do you feel so strongly given 2 isn't undefined? I am starting to believe it is.
1483814335
vÍnce
Pro
Sheet Author
I believe it is undefined. &nbsp;I really do. &nbsp;But, I don't want it to be... I'll keep trying Mr. Miyagi.
1484643518

Edited 1545180833
vÍnce
Pro
Sheet Author
Breakthru!!! With help from&nbsp; Chris B . and&nbsp; Stephen making me wax his cars... I changed ["weapon1_quality"] inside the getAttrs thread to ["repeating_weapons_" + rowid + "_weapon1-quality"] // convert weapon quality selector from numeric value to text var qualitySwap = function() { // get weapon quality text values getAttrs(["weapon1-quality"], function(values) { var qualityName, list = ["None", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], index = values["weapon1-quality"]; qualityName = list[index]; console.log("....Given: " + values["weapon1-quality"]); console.log("....Index: " + index); console.log("....QualityName: " + qualityName); setAttrs({ "weapon1-quality": qualityName }); }); // get repeating weapon quality text values getSectionIDs("repeating_weapons", function(ids) { var fields = _.map(ids, function(id) { return "repeating_weapons_" + id + "_weapon1-quality" console.log("....Row id " + id); }); getAttrs(fields, function(values) { _.each(ids, function(rowid, i) { console.log("....repeating_weapons_" + rowid + "_weapon1-quality"); var qualityName, list = ["None", "Balanced", "Blunt", "Deep Impact", "Jointed", "Long", "Precise", "Short"], index = values["repeating_weapons_" + rowid + "_weapon1-quality"]; qualityName = list[index]; console.log("....Row id " + rowid); console.log("....Given: " + values["repeating_weapons_" + rowid + "_weapon1-quality"]); console.log("....Index: " + index); console.log("....QualityName: " + qualityName); setAttrs({ ["repeating_weapons_" + rowid + "_weapon1-quality"]: qualityName }); }); }); }); } And I finally get what I needed to see! Now I can move forward. Thanks for the help. This has been a PITA! for such a simple thing. EDIT: I updated the final working function in case anyone wanted to see the functioning code.