Help

Create a form to update multiple fields in a table

Topic Labels: Extensions Formulas
Solved
Jump to Solution
396 5
cancel
Showing results for 
Search instead for 
Did you mean: 
CharlieMullin
6 - Interface Innovator
6 - Interface Innovator

I use several different forms that let users update field values. Upon submission a new record is created in an UPDATES table and the associated record is updated in the ASSETS table. This is accomplished using Kuovonne's Prefilled Form extension.

Note that if a user submits this form and the field value on the form is empty, then the associated existing value in the ASSETS table will now be empty as well, which is expected. To prevent this, I can make that field in the form mandatory in order to submit, so it contains a value.

However, I am facing a situation where there are six or so fields that a user may want to update -- but may only want to update some of those fields. Is there a way to add conditional code with this logic?:

Upon submitting the form
     - For each field that is empty - do nothing
     - Else, execute the code to update the field value in the ASSETS table

Maybe such logic can be incorporated into Kuovonne's Prefilled Form extension?

Any ideas or examples would be helpful.

Thanks!

 

 

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

I recently added a script to my automation helpers that lets you input a main value and an alternative value. If the main value is not blank, the script outputs the main value. If the main value is blank, the script outputs the alternative value. 

In your automation, you could do a find record action to find the record to be updated. Then for each field that might be blank in the form record, have an action where the "useAlterantiveValue" script determines if you should use the value from the form record or the value from the original found record. Finally, in your update record action, use the values outputted by the script. Note that this might be a bit tricky for some field types, as the values from "find records" tend to be arrays versus flat data values.

See Solution in Thread

5 Replies 5

Sure, you would just need to create many different conditional actions in your automation. Note that Airtable has a limit on the number of actions that they allow per automation. I think the limit is 25.

p.s. If you want the absolutely easiest way to do this, that doesn't require another table to collect your form submissions, that doesn't require any automations at all, and doesn't require any prefill links at all, I would HIGHLY RECOMMEND that you check out Fillout's advanced forms for Airtable, which is 100% free.

Fillout lets you UPDATE RECORDS from a form, amongst many other features:

It offers multi-page forms, conditional paths for pages, accepting payments on forms, updating Airtable records from a form, creating linked records on a form, specifying the maximum number of linked records, displaying lookup fields & formulas & rollup fields on forms, and dozens of advanced Airtable-specific features that are not available in Airtable’s native forms.

Best of all, Fillout has direct, live, real-time communication with Airtable. There is no better form tool on the market that has better communication with Airtable than Fillout, because it was built from the ground up to work with Airtable.

I give a brief demonstration of Fillout on this episode of the BuiltOnAir Podcast. https://www.youtube.com/watch?v=xrqXdRNmQIY&list=PLqssva4liHRwHhQIpTXekG8WObEoyC2F1

kuovonne
18 - Pluto
18 - Pluto

I recently added a script to my automation helpers that lets you input a main value and an alternative value. If the main value is not blank, the script outputs the main value. If the main value is blank, the script outputs the alternative value. 

In your automation, you could do a find record action to find the record to be updated. Then for each field that might be blank in the form record, have an action where the "useAlterantiveValue" script determines if you should use the value from the form record or the value from the original found record. Finally, in your update record action, use the values outputted by the script. Note that this might be a bit tricky for some field types, as the values from "find records" tend to be arrays versus flat data values.

Thanks @kuovonne , that sounds like a great solution. On your automation helpers, I can't tell which script you're referring to. Tell me more about making payment for the script, and will you provide basic support if needed?

The Automation Helpers contains several individual short scripts in a single package. You purchase the scripts through Gumroad, and you can access the scripts from your Gumroad account. Each script is in its one file/page and identified by name. Find the one you want and copy/paste the entire text of the script into the Airtable script editor, replacing any placeholder code already in the editor. Then setup the input variables in the left side of the script editor as described in the script itself. You do not have to make any edits to the code itself. 

As for support, I find that my customers who already are comfortable configuring and testing automations do not need support. When people have issues, the vast majority of the time it is because they have not set up the input variables correctly. I am not able to provide personal, base-specific support at the current low price. 

Hi @kuovonne , thanks for explaining how the script purchase works and I understand the support model. I'm looking forward to getting started soon. Really appreciate your help!