Skip to main content

Using Script in Automation


Forum|alt.badge.img

I wrote my first script, tested it and it works ! I Used the Script template from " Table optimizer" to convert “wide” table to “long” one.

Now I am trying to utilize this script in my Automation routine using trigger and it doesnt run. I coped and pasted script into Automation, but when I test it, it give me error:

TypeError: input.config.table is not a function

Any help ?

Forum|alt.badge.img+17

Not the same environment, automations run on Airtable’s own servers. input.config is no the same thing in the cloud, it’s basically a variable.

edit: come to think of it, it is the same thing, you’re just observing the test run and tackling an issue from a different perspective.

anyway, re-declare the symbols giving you trouble and get rid of the input.config object from the original Automation script.


kuovonne
Forum|alt.badge.img+27

ìnput.config() works very differently in scripting app compared to in an automation action script. In an automation action script, you cannot get a table directly. You can only get input variables.

For more information, see the documentation here.


Forum|alt.badge.img+4

Hi @kuovonne @K_V , I looked at the documentation you recommended, but couldn’t get it to work. Would you be able to look at my script to say what’s missing?


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • March 1, 2022
Olu_Adebajo wrote:

Hi @kuovonne @K_V , I looked at the documentation you recommended, but couldn’t get it to work. Would you be able to look at my script to say what’s missing?


Welcome to the Airtable community!

As I said in my previous post, ìnput.config() works very differently in scripting app compared to in an automation action script. You also cannot use input.recordAsync in an automation script.

In order to get the script to work, you would need to rework most of your script. Everything that has squiggly red underlines would need to change. If you want more personal advice on how to do this, you can book a meeting.

On the other hand, it looks like you are just trying to timestamp a record with the time an automation has run. You may be interested in my Automation Helpers Scripts. One of the scripts output a timestamp that can be used in a later Update Records action.


Reply