Skip to main content
Answer

Create a new Record and Defining a Multiple Select Field

  • October 2, 2022
  • 4 replies
  • 78 views

Forum|alt.badge.img+3

Hi there,

I am trying to create a script that will create new records in one table based on ‘template’ records from another table, and I’m running into an issue when creating the records with Multiple Select fields. I can successfully use the “creatRecordsAsync” method to create a new record, and can successfully push a string or a boolean to the record. But when I try to create a new record and push a Multiple Select value in, it is erroring out. The string value that I am trying to push in matches the string value of the Multiple Select option in my target table. But I am getting this error when I run the script:

Error: Field “fldntpeWlvbdfgN8Z” cannot accept the provided value.

Any insight? I’m guessing I need to find out the id of the Multiple Select value I’m trying to push somehow?

Best answer by kuovonne

Aaaaaand figured it out about a minute after I posted this. I need to use this format when passing the field value in:

"Field": [{name: value}]


This will only work if you get the cell value as a string and if the template has only one value in the multi-select. If the template has multiple values in the multi-select field, this will not work.

There are multiple possible reasons why the original method of copying the template value over did not work. One possibility is due to the fact that the template is in a different table. I usually keep my templates in the same table as the final records because it makes maintenance easier—you don’t have to keep fields in two tables in parallel.

4 replies

Forum|alt.badge.img+3
  • Author
  • New Participant
  • October 2, 2022

Aaaaaand figured it out about a minute after I posted this. I need to use this format when passing the field value in:

"Field": [{name: value}]


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Answer
  • October 2, 2022

Aaaaaand figured it out about a minute after I posted this. I need to use this format when passing the field value in:

"Field": [{name: value}]


This will only work if you get the cell value as a string and if the template has only one value in the multi-select. If the template has multiple values in the multi-select field, this will not work.

There are multiple possible reasons why the original method of copying the template value over did not work. One possibility is due to the fact that the template is in a different table. I usually keep my templates in the same table as the final records because it makes maintenance easier—you don’t have to keep fields in two tables in parallel.


Forum|alt.badge.img+3
  • Author
  • New Participant
  • October 2, 2022

This will only work if you get the cell value as a string and if the template has only one value in the multi-select. If the template has multiple values in the multi-select field, this will not work.

There are multiple possible reasons why the original method of copying the template value over did not work. One possibility is due to the fact that the template is in a different table. I usually keep my templates in the same table as the final records because it makes maintenance easier—you don’t have to keep fields in two tables in parallel.


Great tip about making the templates in the same table. That will definitely make passing object values a lot easier.


Forum|alt.badge.img+3
  • Author
  • New Participant
  • October 2, 2022

Great tip about making the templates in the same table. That will definitely make passing object values a lot easier.


Okay, so re-did the automation/script so that the templates are in the same table (denoted with a “template?” checkbox field.) It worked! Much easier as I can just get the field values and not have to worry about which type each field is.