Well this part of the code is pretty long... I can still try to copy part of it, but there is a lot of custom functions that make it hardly readable for someone not involved: So basically, this is an import from an old version of my sheet, to a new version... I get through all the entries (karray is the result of a getsectionID) and look if they have a "Link" (which is a cross reference between 2 repitems, possibly from different sections) buildPre is a function that helps building the prefix for my repitems (they are like repeating_talents_thisistherowid_T_Name). So I have a pre (the item that I am currently updating), and a pre2(the item it links to), and for each prefix, because getsetctionID returned a vandalized rowID, I have the vandalized and non-vandalized version of the prefix (gosh I hate this vandalization stuff... I first suspected it was the source) repeatSection is a function that returns one of the sections between underscores of repeating_talents_thisistherowid_T_Name, so that I can find the rowid from a fullname, or the code. Finally values is what I got from my getAttrs, and vals is the array that I will feed at the end my function to setAttrs //Knacks for( i = 0; i < karray.length; i++ ){ newflags=updateRow( "NAC", karray[i],newflags); //Link import logic is buggy let prev=buildPre("NAC", karray[i]), //vandalized pre=buildPre("NAC",values[prev+"RowID"]); //non vandalized let links = values[prev+"Linked"]; if (links){ // This section is for importing links. Up to v2, only Knacks had links and links were unidirectional log ("links before sanitizing" + links) ; links = links.replace( /[\{|\(|\)|\@|\}]/gi, ""); //Sanitizing.links if it exists is in the form of an autocalc i.e (@{fully_qualifiedname}+@{fully_qualifiedname}). After sanitizing they will be fully_qualifiedname+fully_qualifiedname linkArray=links.split("+");// Now we split the list by +, so we get an array [ fully_qualifiedname,fully_qualifiedname] for(j=0;j<linkArray.length;j++){ if(linkArray[j].startsWith("repeating")){ //Non Spellcasting Talents are on the repeating_XXX-RowId format let rid= repeatSection(2,linkArray[j]); let pre2v=buildPre(repeatSection(3,linkArray[j]),rid.toLowerCase()), // Really don't know why, but we need a vandalized rowid pre2=buildPre(repeatSection(3,linkArray[j]),rid) let tal= values[pre2v+"Name"]; log("tal " +tal + " pre " +pre + " prev " +prev+ " pre2 "+pre2 + " pre2v" +pre2v); if(! tal) log ("Earthdawn: UpdateCharacterSheet - Tried to create a link to an ability that doesn't exist: " + rid); // This line is to get rid of dead links... else {if (!linkArray[j].endsWith("Mods") && tal!==undefined && repeatSection(3,linkArray[j])!=="NAC"){ //Links with Talents and Weapons have 2 entries, so one of them has to be skipped if(!vals[pre+"LinksGetValue_max"]){//This is the first link to be created vals[pre+"LinksGetValue_max"]=pre2+"Effective-Rank" vals[pre+"LinksGetValue"]=tal; } else { vals[pre+"LinksGetValue_max"]+=","+pre2+"Effective-Rank" vals[pre+"LinksGetValue"]+=","+tal; } //that's an addition link if(!vals[pre2+"LinksProvideValue_max"]){//This is the first link to be created vals[pre2+"LinksProvideValue_max"]="NAC;"+karray[i]; } else { vals[pre2+"LinksProvideValue_max"]+=",NAC;"+karray[i]; } //that's an addition link } } } } } newflags=addAPIflag( newflags, "RemoveAttr", pre+"Linked" ); newflags=addAPIflag( newflags, "RemoveAttr", pre+"LinkDisplay" ); };