Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
Yes there is an easy way to do this with script.
The following essential code applied to the page ?a=DformProps&dfid=2 will substitute the existing fid=7 with the fid=8 in the form.
Notes:
(1) The script basically selects all hidden inputs on the form with a name attribute starting with the characters "hfi". Next if filters out the single input for which the third "~*~" delimited string is the fidFrom value. Finally it changes the following <select> value to the fidTo value.
It may seem all mysterious but QuickBase uses a proprietary encoding of all the form's properties in various delimited strings stored as attributes on hidden <input>s - in this case the delimiter is the three character string "~*~".
(2) Don't let anyone tell you it can't be done with QuickBase.
The following essential code applied to the page ?a=DformProps&dfid=2 will substitute the existing fid=7 with the fid=8 in the form.
var fidFrom = "7";To get the code to convert all fifty forms you simply have to wrap a loop around it using an <iframe> and submit the form using native Submit or FormData. I would create a demo but it is hard to do so and make it available to everyone on the internet.
var fidTo = "8";
$("input[type=hidden][name^=hfi]")
.filter(function() {
var value = $(this).val().split("~*~")[2];
if (value == fidFrom) {
return true;
}
})
.next("select")
.val(fidTo);
Notes:
(1) The script basically selects all hidden inputs on the form with a name attribute starting with the characters "hfi". Next if filters out the single input for which the third "~*~" delimited string is the fidFrom value. Finally it changes the following <select> value to the fidTo value.
It may seem all mysterious but QuickBase uses a proprietary encoding of all the form's properties in various delimited strings stored as attributes on hidden <input>s - in this case the delimiter is the three character string "~*~".
(2) Don't let anyone tell you it can't be done with QuickBase.