Skip to main content

Bonus Exercise 3.2: Use the Action in a Flow

Duration: 15 minutes

In this bonus exercise, we will add the Action to a scheduled Flow to keep our Airport information up to date on a regular basis.

  1. Close all the pop-up boxes and click on the + tab
  1. Click Flow
  1. Under Flow name, enter Update airport information
  1. Set Run As to System User
  1. Click Submit
  1. Click Add a trigger, then select Daily under date. This will run this workflow everyday
  1. Click Done
  1. Click Add an Action, Flow Logic, or Subflow
  1. Click Action
  1. Search and select Look Up Records - Pay special attention to selecting Look Up Records and not Look Up Record
  1. Search and select Airport under Table
  1. Click Done
  1. Click Add an Action, Flow Logic, or Subflow
  1. Click Flow Logic
  1. Click For Each
  1. Drag and drop the Airport Records data pill from the right sidebar onto the Items field
  1. Click the small + icon directly under the For Each Item in step
  1. Click Action
  1. Search and click Get Airport Details (this was the API integration action we just created)
  1. Expand Airport Record on the right sidebar under the 2 - For Each section
  1. Drag and drop the Code data pill onto the IATA Code field
  1. Click Done
  1. Add a new For Each Flow Logic under Get Airport Details
  1. Drag and drop the Output data pill from the 3 - Get Airport details section onto Items
  1. Click the small + icon directly under the new For Each Item in step
  1. Click Action, then search and select Update Record
  1. Drag and drop the Airport Record data pill under 2 - For Each onto the Record field
  1. Click + Add field value
  1. Search and select Lat, expand the response_object data pill under 4 - For Each
  1. Drag and drop the lat data pill on the empty field
  1. Click + Add field value
  1. Search and select Lon, expand the response_object data pill under 4 - For Each
  1. Drag and drop the lng data pill on the empty field
  1. Refer to the full animation below:
  1. Click Done
  1. Click Activate on the top right
  1. Click Test
  1. Click Run Test
  1. This will take a few minutes to run as we have 24 airports to update. Once done, click Your test has finished running. View the flow execution details.
  1. Review the execution, take some time to expand each step to understand what has happened in this flow
  1. Go back to App Engine Studio and preview the Airport table
  1. This will open in a new tab, verify that all the Lat and Lon fields are now populated

This flow should now run everyday to update the latitude and longitude of each airport in your table.

In a real life scenario, you could do so much more with the API, but this is just an example to show you the possibilites.

For example, you could integrate with a complex booking API like Amadeus, and your users could search for flights and book flights and hotels directly from your custom application!