ContributionsMost RecentMost LikesSolutionsRe: Got CSV To Import?Thanks, this worked well... I spent ages trying to get Encoding to work in the CSV import but could not get it right... although native quickbase's import table function respects file encoding, getting it to work with the API seems very difficult... but normalizing it is fine as the whole app is in English anywayRe: Got CSV To Import?Hi, I was able to implement this, based on the example here - and it worked great except if a field contains a non-ASCII character such as a Spanish word (e.g.ma�ana) then it's imported asma�1�2ana .... Any tips as to how to fix this? Thanks!Re: Javascript code for-loop calculation helpWow that's fantastic Neil, thanks so much I just implemented it, and the button works perfectly now! Thanks!Javascript code for-loop calculation helpHi, I have a simple javascript code page which duplicates an item (original question herehttps://community.quickbase.com/quickbase/topics/javascript-to-copy-a-record-n-number-of-times-and-i...) .... I'm still learning Javascript and I need some help fixing up this loop: In the code below, a) it first retrieves the 'monthStart' variable (can be anything from 1 to 12) b) it then prompts user for number of iterations (1 to 12), c) It then copies the item 1 to 11 times, adding + 1 to the "nextmonth" field till "nextmonth" = 12 Now this works fine if the 'monthStart' = 1 (for January) - it then copies it 11 times and sets the value 2 (feb)to 12 (dec). - it stops always when nextMonthgets to 12. However we use a financial year from July (7)to June (6)... which means the month goes past 12 and starts at 1 again. I would like to modify the code so that if 'monthStart' = 7 (or any other number) and the Prompt = 12, then it will copy 11 times, and set 'nextMonth' to the values8, 9, 10, 11, 12, 1 , 2, 3, 4 , 5, 6 - e.g. up to the value of 'monthStart' I'm hoping that makes sense? Please see the code below ========start code ============== // This is used by the button that duplicates an item many times var numMonths = prompt(" How many months to copy? enter 12 for whole year", 12);// Prompt for number of times to copy var monthStart = parseInt(itemMonth, 10);//this is the starting month from Quickbase var nextMonth = monthStart + 1; var xhttp; try{ if (window.XMLHttpRequest) { xhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } if(numMonths > 0 && numMonths < 13){ for(var i = 0; i <= numMonths - 1 && nextMonth < 13; i++){ myAPI = addItem + commonfields + "&_fid_43=" + nextMonth; xhttp.open("GET", myAPI, false); xhttp.send(); nextMonth += 1; } } location.reload(); } catch(e){ console.log("Unexpected Error: " + e); } ======end code ========== Re: Javascript to Copy a Record n number of times and increment a numeric field?I have one more quick question :) - With the Javascript code below, If i set "How many months to copy to?" = 12... then it only works when Month = 1 (January) as it stops when it hits december (12) ... Can you please let me know how to modify it so that if the initial month is another number (like 7 for July) and the Prompt is 12, then it should create months for 8, 9, 10, 11, 12, 1 , 2, 3, 4 , 5, 6 ... i.e. when it gets past 12 it starts at 1 again until the starting month value? ============================================== // This is used by the button that duplicates an item many times // Prompt for number of times to copy var numMonths = prompt(" How many months to copy? enter 12 for whole year", 12); //this is the starting month from Quickbase - i.e. 7 for July var monthStart = parseInt(itemMonth, 10); var nextMonth = monthStart + 1; var xhttp; try{ if (window.XMLHttpRequest) { xhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } if(numMonths > 0 && numMonths < 13){ for(var i = 0; i <= numMonths - 1 && nextMonth < 13; i++){ myAPI = addItem + commonfields + "&_fid_43=" + nextMonth; xhttp.open("GET", myAPI, false); xhttp.send(); nextMonth += 1; } } location.reload(); } catch(e){ console.log("Unexpected Error: " + e); } EDIT: I posted this as a seperate question, which is better worded, so it get's seen:https://community.quickbase.com/quickbase/topics/javascript-code-for-loop-calculation-help?rfm=1&.Re: Javascript to Copy a Record n number of times and increment a numeric field?It's a year later, but thanks so much for this, I managed to get it to work Here's my modifications to your code in case this helps someone one day CODE PAGE: DuplicateItemMonthly.js var numMonths = prompt("For how many months do you want to duplicate this item?", 1); var monthStart = parseInt(itemMonth, 10); var nextMonth = monthStart + 1; var xhttp; try{ if (window.XMLHttpRequest) { xhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } if(numMonths > 0 && numMonths < 13){ for(var i = 0; i <= numMonths && nextMonth < 13; i++){ myAPI = addItem + commonfields + "&_fid_43=" + nextMonth; xhttp.open("GET", myAPI, false); xhttp.send(); nextMonth += 1; } } location.reload(); } catch(e){ console.log("Unexpected Error: " + e); } BUTTON CODE: var text commonfields = ToText( "&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & URLEncode([Comments]) & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & URLEncode([General Cost Description]) & "&_fid_122=" & [People Cost Number of Days Required] & "&_fid_156=" & URLEncode([Item Vendor]) & "&_fid_160=" & [Spend Country] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity Completed] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & URLEncode([Original Item Project Category]) & "&_fid_305=" & [Item has been Deferred] & "&_fid_302=" & [Select Month For Split] & "&_fid_299=" & [People Cost # Days to DEFER] & "&_fid_296=" & [Predefined Daily Cost Qty to DEFER] & "&_fid_295=" & [Predefined Daily Cost # of Days to DEFER] & "&_fid_294=" & [Predefined Daily Cost Days / Qty] & "&_fid_292=" & [Predefined Cost Quantity to DEFER] & "&_fid_281=" & [General New Split Qty to DEFER] & "&_fid_280=" & [General New Split Unit Cost to DEFER] & "&_fid_279=" & [General Split Cost / Qty?] & "&_fid_259=" & [Item Completion Status]); var text apptoken = "MY APP ID"; var text addItem = ToText(URLRoot() & "db/" & "MY TABLE ID" & "?a=API_AddRecord&apptoken=" & $apptoken); var text itemMonth = ToText([Month Number]); "javascript:var addItem='" & $addItem & "';var itemMonth='" & $itemMonth & "';var commonfields='" & $commonfields & "';$.getScript(gReqAppDBID + '?a=dbpage&pagename=DuplicateItemMonthly.js');void(0);" Re: Javascript help to duplicate and modify entry N number of timesThanks, that's a novel no-script solution! However I had a brain fade when I posted this... I realised that I had posted the question a year ago (sigh)https://community.quickbase.com/quickbase/topics/javascript-to-copy-a-record-n-number-of-times-and-i...and there was a javascript answer in that which I managed to get working, I posted the relpy there. Thanks so much for your help!Javascript help to duplicate and modify entry N number of timesHi, I have a function which duplicates an entry and modifies a field with each duplicate... it works but it's clunky. The only field that changes is "month number" (not a date) - i.e. you enter the first item in Month Number = 1, then it duplicates it 11 times setting the month number from 2 to 12... This was written without javascript, but quickly the resulting URL was far too long so I had to split it into two different buttons to press...even then it sometimes has issues running if any of the source fields have a lot of data in them.... Also it doesn't refresh the page after it's done. I would like some help / suggestions on how to modify this code below so that: 1. Javascript is used to execute each iteration - so the function can be done with one button and doesn't break if the URL is too long due to large fields... 2. After the function is complete, the page refreshes. Below is my current code - from the first button (loops 6 times to keep url length down): //define the fields that are the same in each iteration var text COMMMONFIELDS = "&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & URLEncode([Comments]) & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & URLEncode([General Cost Description]) & "&_fid_122=" & [People Cost Number of Days Required] & "&_fid_156=" & URLEncode([Item Vendor]) & "&_fid_160=" & [Spend Country] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity Completed] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & URLEncode([Original Item Project Category]) & "&_fid_305=" & [Item has been Deferred] & "&_fid_302=" & [Select Month For Split] & "&_fid_299=" & [People Cost # Days to DEFER] & "&_fid_296=" & [Predefined Daily Cost Qty to DEFER] & "&_fid_295=" & [Predefined Daily Cost # of Days to DEFER] & "&_fid_294=" & [Predefined Daily Cost Days / Qty] & "&_fid_292=" & [Predefined Cost Quantity to DEFER] & "&_fid_281=" & [General New Split Qty to DEFER] & "&_fid_280=" & [General New Split Unit Cost to DEFER] & "&_fid_279=" & [General Split Cost / Qty?] & "&_fid_259=" & [Item Completion Status] & "&apptoken=blahblahmytoken"; //define the fields that change with each iteration var text AddAug = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "8" & $COMMMONFIELDS; var text AddSep = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "9" & $COMMMONFIELDS; var text AddOct = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "10" & $COMMMONFIELDS; var text AddNov = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "11" & $COMMMONFIELDS; var text AddDec = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "12" & $COMMMONFIELDS; var text AddJan = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "1" & $COMMMONFIELDS; var text AddFeb = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "2" & $COMMMONFIELDS; var text AddMar = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "3" & $COMMMONFIELDS; var text AddApr = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "4" & $COMMMONFIELDS; var text AddMay = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "5" & $COMMMONFIELDS; var text AddJun = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord" & "&_fid_43=" & "6" & $COMMMONFIELDS; //combine it all into a URL button $AddAUG & "&rdr=" & URLEncode($AddSEP) & URLEncode("&rdr=" & URLEncode($AddOCT)) & URLEncode(URLEncode("&rdr=" & URLEncode($AddNOV))) & URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddDEC)))) & URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddJAN))))) Re: Javascript to Copy a Record n number of times and increment a numeric field?Hi Again, I was able to implement the record copy and increment using API_AddRecord successfully for ONE month (one iteration) ... BUT as soon as i put in all the iterations, the URL became too long for QuickBase's html server :( I have the error Bad Request - Request Too Long HTTP Error 400. The size of the request headers is too long. Here's my formula below (with api key redacted) - is there anyway to simplify this so that it will fit? START CODE ========================================== var text AddAug = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "8" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddSep = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "9" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddOct = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "10" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddNov = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "11" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddDec = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "12" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddJan = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "1" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddFeb = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "2" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddMar = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "3" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddApr = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "4" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddMay = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "5" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; var text AddJun = URLRoot() & "db/" & [_DBID_NEWITEMS] & "?act=API_AddRecord&_fid_8=" & [Budget Status Flag] & "&_fid_22=" & [Comments] & "&_fid_25=" & [Account Code] & "&_fid_28=" & [Related Company] & "&_fid_244=" & [Item Status] & "&_fid_72=" & [General Cost Currency] & "&_fid_73=" & [General Cost Description] & "&_fid_122=" & [Number of Days Required] & "&_fid_156=" & [Item Vendor] & "&_fid_160=" & [Spend Country] & "&_fid_161=" & [Related Project Manager] & "&_fid_9=" & [Recoverable?] & "&_fid_165=" & [General Cost Quantity] & "&_fid_164=" & [Predefined Daily Cost Quantity] & "&_fid_163=" & [Predefined Cost Quantity] & "&_fid_114=" & [Related People Cost] & "&_fid_81=" & [Predefined Daily Cost Days] & "&_fid_71=" & [General Unit Cost] & "&_fid_69=" & [Related Predefined Daily Cost] & "&_fid_68=" & [Related Predefined Cost] & "&_fid_37=" & [Related Fx] & "&_fid_32=" & [Item Type] & "&_fid_47=" & [Related Sub-Project] & "&_fid_241=" & [Original Item Project Category] & "&_fid_43=" & "6" & "&apptoken=thisismyapptoken_doineedtorepeatiteachtime??"; $AddJAN & "&rdr=" & URLEncode($AddFEB) & URLEncode("&rdr=" & URLEncode($AddMAR)) & URLEncode(URLEncode("&rdr=" & URLEncode($AddAPR))) & URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddMAY)))) & URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddJUN))))) & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddAUG)))))) & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddSEP))))))) & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddOCT)))))))) & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddNOV))))))))) & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($AddDEC)))))))))) =============================================== END CODE (These Forums really need a "Code" snippet button) _Re: Javascript to Copy a Record n number of times and increment a numeric field?All of my users use the latest Chrome so I think i'll be ok with the URL limit.... I am trying to get the code working with just ONE copy + Increment action first (this is my first time coding a url formula, but i'm trying to learn) So with using the API_AddRecords - to duplicate my record will i need to map each and every source field to the target field - which since i'm creating a duplicate is just each field mapped upon itself? (thus hardcoding it in this formula - bit of a pain if the items table has new fields added at some point?) .... so the url becomes really really long because i have ~60 editable fields to copy thus your concern about the length? - or should i instead be using "GenCopyRecord" to copy the item, and then just edit the "Month Number" field ? or is it too hard to lock onto the correct field that way? Am I on the wrong track (i'm still reading about the API/URL formulas) Thanks!