Help

Scripting problem

Topic Labels: Automations
Solved
Jump to Solution
1363 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Matthieu_Chatea
5 - Automation Enthusiast
5 - Automation Enthusiast

I have a problem with a script that worked and all of a sudden, stopped to work:

"App Name" is a linked record field. "Add App On Sign Up" is another linked record field. When a value is inserted in "Add App On Sign Up", I need this value to be inserted in "App Name" (inserted, meaning adding a value, not replacing a value to "App Name".

Anyone has a better script to propose?

The error message is:

Error: Field "fldGBiazYCpFzbsOv" cannot accept the provided value.
    at main on line 12

Field "fldGBiazYCpFzbsOv" is the field id of App Name

 

 

 

const table = base.getTable("Members");

const query = await table.selectRecordsAsync();

for (const record of query.records) {
  const appNames = record.getCellValue("App Name");
  const addAppOnSignUp = record.getCellValue("Add App On Sign Up");

  if (appNames && addAppOnSignUp) {
    const updatedAppNames = appNames.map(appName => appName).concat(addAppOnSignUp);

    await table.updateRecordAsync(record, {
      "App Name": updatedAppNames
    });
  }
}

 

 

 

 

1 Solution

Accepted Solutions
Matthieu_Chatea
5 - Automation Enthusiast
5 - Automation Enthusiast

I solved it by changing the script to perform an update in the Apps table and not directly in the Members table

See Solution in Thread

1 Reply 1
Matthieu_Chatea
5 - Automation Enthusiast
5 - Automation Enthusiast

I solved it by changing the script to perform an update in the Apps table and not directly in the Members table