Skip to main content

Sync records with an external API

Pull a value from an external service into Tape every day. Tape sends an HTTP request, then writes the answer to all matching records in a database app.

Written by Leo

This recipe reads data from another service on a schedule and stores it in Tape. The example fetches a daily exchange rate and writes it to every open deal in euros. It's meant to keep numbers in your CRM current without anyone typing them in.

Automation editor with the finished recipe: trigger Every day at 8:00 AM in Deals, Send a HTTP request using GET method to <a href="https://api.acme.com/rates?base=USD&amp;symbol=EUR" rel="nofollow noopener noreferrer" target="_blank">https://api.acme.com/rates?base=USD&amp;symbol=EUR</a>, Search for records in Deals where Currency Is EUR and Status Is Open, and Update all collected records in Deals with Exchange rate set by Calculation to var_http_response.rate

What you'll need

  • A Deals database app with these fields:

  • Currency, a single select field with the option EUR

  • Exchange rate, a number field

  • Status, a status field with the option Open

  • An API that answers a GET request with the value you need, for example https://api.acme.com/rates?base=USD&symbol=EUR. If the API needs a key, add it under Show headers → Add header in Send HTTP request, or use Send API request with a saved connection.

Build the automation

  1. Open the Deals app and click the automations icon at the top right (Create and view automations).

  2. Select New automation, then select On a scheduled time or interval.

  3. In the trigger, select One time and choose Every day, then pick 1 day. Select 8:00 AM to set the time.

  4. Select Add action → Send HTTP request. Keep the method GET and enter the address in URL. The response is saved in HTTP response.

  5. Select Add action → Search for records. Choose the Deals app, select Add filter, and add Where Currency Is EUR. Add a second condition for Status Is Open.

  6. Select Add action → Update collected. Tape preselects Deals, the records that Search for records collected.

  7. Select Add field and choose Exchange rate. Select Calculation instead of Set value, insert HTTP response, and add the name of the value, for example .rate.

  8. Select Create automation.

Note:

  • Pick one value of the answer. HTTP response holds the whole answer of the service. Step 7 picks the one value you need, so check the name of that value in the API's documentation.

  • Keep it short. A run stops after three minutes, and a search returns at most 1,000 records. For more records, split the work. Learn how to update many records in batches →

  • Public hosts only. Requests come from Tape's own IP addresses, and private or internal hosts are refused. Learn more about IP addresses →

The result

Every morning, each open euro deal gets the latest exchange rate in Exchange rate. A calculation field in the database app can use it to show the amount in euros.

Variations

  • Use POST with a request body to send records to another service.

  • Add Conditional actions after the request to stop when the service answers with an error.

  • Run the automation every hour for values that change quickly.

Learn more

FAQs

Can I send data from Tape to the other service?

Yes! Use Send HTTP request with POST, and put record values in the request body. Learn more about sending requests →

Why didn't the records change?

If the records didn't change, it could be because:

  • The search found no records. Check its filters.

  • The request failed. Open the run history and check the Send a HTTP request step.

  • The automation is Paused.

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: http_call in the developer docs →

Still have more questions? Find answers and get help from community experts in the Tape community →.

Did this answer your question?