Skip to main content

Error with -> input.recordAsync is not a function

  • October 25, 2022
  • 4 replies
  • 96 views

Forum|alt.badge.img

Hi all,

I have an error when I reproduce this example: Airtable Scripting

let record = await input.recordAsync(‘Select a record to use’, table);

Throw this error:

TypeError: input.recordAsync is not a function

Does anyone have an idea of what I need to change?

Thanks,

Arthur

4 replies

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

Are you writing an automation script?
Automation scripts cannot take user input.

Instead setup your script to use input.config() and automation input variables.


Forum|alt.badge.img
  • Author
  • New Participant
  • October 25, 2022

Are you writing an automation script?
Automation scripts cannot take user input.

Instead setup your script to use input.config() and automation input variables.


Thanks!
I don’t want to take a user input, but I do want to use a script within an automation. I want to send to that script a record from an interface using a button. I thought to use the “When a button is clicked” trigger. But I don’t see a way to get the record as an input.

I saw that post, but I guess it doesn’t concern an interface button.

I guess I can not use a button from my interface but will have to do it directly from the grid with a button field.


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

Thanks!
I don’t want to take a user input, but I do want to use a script within an automation. I want to send to that script a record from an interface using a button. I thought to use the “When a button is clicked” trigger. But I don’t see a way to get the record as an input.

I saw that post, but I guess it doesn’t concern an interface button.

I guess I can not use a button from my interface but will have to do it directly from the grid with a button field.


You can do this. You need to use input.config() in combination with an input variable to get the record ID of the triggering record. It is documented here. Note that you need to use the version for automations.


Forum|alt.badge.img
  • Author
  • New Participant
  • October 28, 2022

Hi Kuovonne,

Great, simple and easy indeed. Thank you for your help!