Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: Button to copy data from field 1 to field 2

3792 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Colin_Rathbun
6 - Interface Innovator
6 - Interface Innovator

Hello. I’m learning the scripting block and not a programmer but hope to get my feet wet.

I have taken the basic script to “select a record” and added that to a button called COPY.

// Change this name to use a different table 
let table = base.getTable("Table 3");
// Prompt the user to pick a record 
// If this script is run from a button field, this will use the button's record instead.
let record = await input.recordAsync('Select a record to use', table);
if (record) {
// Customize this section to handle the selected record 
// You can use record.getCellValue("Field name") to access 
// cell values from the record
output.text(`You selected this record: ${record.name}`);
} else {
output.text('No record was selected');
}

But now I want to use the record selected to copy Field 1 (which is a lookup field) into Field 2 which is just a basic number field.

Can anyone point me how to “copy” data from one field to the other?
image

13 Replies 13
Colin_Rathbun
6 - Interface Innovator
6 - Interface Innovator

Thank you @kuovonne and @Justin_Barrett . Will review! responses much appreciated!

Since you are already using Zapier, is there a particular reason you want to use scripting block instead of Zapier for this? You should be able to setup Zapier with a multi-step zaps where it looks for an existing record and creates one if it doesn’t exist yet.

It has to run so often I’m running out of zaps with all the extra steps. Plus I need to match Plates with previous Plate and Account data, and I can’t seem to make that happen.

Thanks for the explanation. Yes, running out of Zaps could be an issue if you aren’t prepared to pay for more zaps.

Colin_Rathbun
6 - Interface Innovator
6 - Interface Innovator

Hehe. I’m actually at one of the highest levels before going full enterprise at $600 a month!