Forum Discussion
AustinK
5 years agoQrew Commander
Would you want a script to run each time you opened a record and to then place the derived value into a blank field you have, if it is blank(or if the derived value has changed from what is already saved maybe?) Or how did you envision this working?
You cannot just insert a value into an element like that, it is only a visual representation at that point. You need to make an API call to Quick Base for that specific record you are on. So what you would want to do is run something like the Image On Load thing, as you are, but have it load your script from a variable like it expects. Then in the script you will want it to do the stuff you have set but then also make a call to the Quick Base API and do an EditRecord call on the record id you are on and have it set field 9(from your code, I think) to be the value in vendor_length. Then you will probably want to refresh the page and the record should be updated.
There may be other or better ways of doing this too. It might be possible to transform the data in Excel or similar programs too, if it was not a thing you needed done on every record.
You cannot just insert a value into an element like that, it is only a visual representation at that point. You need to make an API call to Quick Base for that specific record you are on. So what you would want to do is run something like the Image On Load thing, as you are, but have it load your script from a variable like it expects. Then in the script you will want it to do the stuff you have set but then also make a call to the Quick Base API and do an EditRecord call on the record id you are on and have it set field 9(from your code, I think) to be the value in vendor_length. Then you will probably want to refresh the page and the record should be updated.
There may be other or better ways of doing this too. It might be possible to transform the data in Excel or similar programs too, if it was not a thing you needed done on every record.