Help

Update Records Help

1099 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Giorgio_Bazziga
6 - Interface Innovator
6 - Interface Innovator

Hello!

I need help updating my records with automation.

There are 2 tables:
one is a table that I use to create reports on the status of our Lights:
each location has an ID, say 1234 and associated barcodes like a light #, a controller # and a pole #

The other is a table of the entries from the tech team doing maintenance in the field.
they report what ID they worked on and if there were changes in the light #, controller # and pole #

Often the tech crew mistypes stuff and I need to review their submissions before changing our table thus not to corrupt our internal database.

So I synch the Tech’s table in my base and added a few columns like Pole # fix which copies their input as a text so I edit it if needed and I can have a comparison between what the tech inputted and what I edited it to.

I then made a checkmark which is the trigger of the automation, essentially saying that everything is good and to update the light #, the pole # and controller # in our table of the ID that they worked on.

I keep getting “received invalid inputs” error when running a test. It does not seem very complicated thing to do. if check mark, look for ID in this table, if found edit these fields.

Help?

Thanks in advance

1 Reply 1
Giorgio_Bazziga
6 - Interface Innovator
6 - Interface Innovator

Much Support, wow
here is my code for what I have gotten so far
//grab info from TF inputs

let TFinputs = base.getTable(“Fishel Inputs 2021”);

let TFview = TFinputs.getView(‘Update Leaf Lease’);

// grab record from previous input

let TFRecID = input.config();

let queryTFinput = await TFview.selectRecordsAsync(); // get all records in TF inputs

let updated_record = queryTFinput.getRecord(TFRecID.TFRecID);

let TFPoleNum = updated_record.getCellValueAsString(“Pole # Fix”);

let TFPanelBar = updated_record.getCellValueAsString(“Panel Barcode”);

let TFLightBar = updated_record.getCellValueAsString(“Light Barcode”);

let TFPoleBar = updated_record.getCellValueAsString(“Pole Barcode”);

let TFDateIn = updated_record.getCellValueAsString(“Day of Entry”);

//grab record to update

let SLlease = base.getTable(“Street Leaf Lease TESTING”);

let SLLview = SLlease.getView(‘Vanilla’);

let querySTLease = await SLLview.selectRecordsAsync(); // get all records in SLLeaselet

var SLLPoleNum

var SLLLight

console.log(querySTLease)

for (let record of querySTLease.records) {

if (record.getCellValue("Pole Number") == TFPoleNum)



CHANGE ALL INFO HERE

//SLlease.updateRecordAsync(record.id, {'Light #':[{ id: TFLightBar}], )

}