Help

How the create a script or button 2 SWAP selected records of a specific fields

312 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Rusty
4 - Data Explorer
4 - Data Explorer

Hi Team,

I have 1 table for base.

I will pick a 2 record to be swap.

I want the FirstName,MiddleName,LastName records will only be swap. There other records belong the FN,MN,LM will still remain.

My Script:

let table = base.getTable("Work Station");
let result = await table.selectRecordsAsync({sorts: [{field: "Station Number"}]});
let record = await input.recordAsync('Pick a record', result);
if (record) {
    output.text(`You picked ${record.getCellValueAsString("Employee Name")}`);
}

let record2 = await input.recordAsync('Pick another record', result);
if (record2) {
    output.text(`You picked ${record2.getCellValueAsString("Employee Name")}`);
}
 
Output should be.
 
Do you confirmed to swap First Name Middle Name LastName and First Name Middle Name Last Name?

If yes, SWAP if No cancel.
 
Please assist me to create a script or button. It much better to linked the clicked button and choose 2nd record to be swap.
 
Thank you.

 

0 Replies 0