Skip to main content

Script for sending an updated field to an external platform via API

  • August 29, 2024
  • 4 replies
  • 44 views

Forum|alt.badge.img+4

Hi, I'm running an automation that monitors a table for certain fields and when any of those fields get updated, I want to run script that sends those field values to an external platform, via an API call to that platform. I know how to write this script, however I can't figure out how to reference the specific record whose field was updated. Is this possible?

Here is a screenshot of my automation.

 

4 replies

TheTimeSavingCo
Forum|alt.badge.img+31

 

Try adding the record ID as an input variable like so:


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • August 30, 2024

Yes, you need to specify the triggering record ID as a variable in the input.config.

I show how to do this when sending records to Make’s advanced API platform in the thread below — be sure to look at the screenshots that I posted:

https://air.tableforums.com/t/instantly-trigger-a-make-com-automation-from-airtable-i-e-sending-airtable-data-to-an-external-webhook-such-as-make-com/159


Alexey_Gusev
Forum|alt.badge.img+25

Hi,
to avoid querying the record by RecordID, you can just add those 3 values to a left side
and then 

const {status,country,camp_office}=input.config()

note that variable names in code must match variable names you set in the left side.
you can also avoid hardcoding and simply pass all available data from left side, cloning input.config() and possibly add some data to it. of course, it depends on platform API requirements

 

 


Forum|alt.badge.img+4
  • Author
  • New Participant
  • September 1, 2024

Thanks so much for your quick responses!