Skip to main content

Hi, I’ve been using Airtable for a few years and a heavy automation user with Make.com and Zapier. However, I don’t have any programming experience whatsoever.

The script is used as one of the steps in my Airtable automation. I’m in need of a script that:

  1. Takes a value from a field
  2. Multiple that value by -1 (negative 1)
  3. Return that value as input for the next step in my Airtable automation

I’ve just started online course on Javascript, but this course obviously takes time and I need the script right away. It would be great if someone can help me out with this so I can implement it right away. From my online course, I know that the code should be straight forward enough even for someone with basic command of Javascript.

Thanks!

You don’t need a script to do this.

You would just need to create a formula field in your Airtable base that does the math ahead of time.

Then, you can reference that formula field in your automation.

Hope this helps! If you’d like to hire an expert Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


Hi Scott,

Thanks for your reply.

Unfortunately, I need the script since:

  1. The input is taken from 1 base and the output is put into another base
  2. I’m trying to reduce the number of fields
  3. Having a field as a ‘temporary’ storage that’s only needed for a split second is an overkill for me

    It’s not that I don’t want to create an extra field; some automations I’ve done in the past have this formula field. However, for this specific field it seems a little overkill

Thanks.


Hi ​@divingintux,

For the actual scripting part of it I would highly recommend you use Chatgpt with a detailed description of your needs and your schema (tables and fields, as well as field types).

For passing the specific record which should be used on the script, you’ll wan to have the record id set as an input on the left margin of your script -see exmaple below. You’ll set a Name and the actual Value which should be the record id (dinamically mapped). Ask chatchpt to get the value from the specific field out of the record id obtained through input.config().
 

  Hope this helps!

Mike, Consultant @ Automatic Nation


Hey ​@divingintux,

I do agree with Scott that in most cases you would want to use a Formula field. But since you do have the most context about your situation, I’ll assume it makes sense to do it with scripts in this case!

 

Here’s an example of how you can use `output.set` to get a value to the next step in your automation:

 

Then, you can use the output like so:


I hope this helps!


​@BuildForAT This solution works. Thanks so much for the reply

​@Mike_AutomaticN Thanks for your answer as well

Onwards to my Javascript course!


Reply