FlowFest V5 Challenges - Challenge 2

FlowFest V5 Challenges - Challenge 2

FlowFest is an online competition where participants have to build flows in Salesforce. Salesforce Ben and Ohanaly hosted the fifth edition, FlowFest V5, on July 11th, 2023. The competition followed the previous format where the top four finalists were chosen after finishing the first two challenges. Then they shared their screens for the final head to head challenge. Let's take a look at the challenges of FlowFest V5. Here is the answer of FlowFest V5 - Challenge 2.

FlowFest V5 - Challenge 2 - Question

Cloud Kicks wants to get more information about their Leads addresses. In order to achieve this, they want to use a public API which gives details about Zip Codes (also known as Postal Codes). Build an Autolaunched Flow that makes an HTTP Callout (GET Method) and returns information about a particular Zip Code.

As a requirement, this Flow should be able to receive either a Lead (as a record) or a Zip Code (as text) as inputs. If the Flow is launched with a Lead record, it should take the Zip Code / PostalCode and use that for the HTTP Callout. For the HTTP callout, use the Named Credential included in your Unmanaged Package called Zippopotam. You should not need to leave the Flow Canvas at any point.

Here are more details about the service:

  • URL format: https://api.zippopotam.us/us/{zipcode}
  • Example: https://api.zippopotam.us/us/90210
  • Example Response:
  • {"post code": "90210", "country": "United States", "country abbreviation": "US", "places": [{"place name": "Beverly Hills", "longitude": "-118.4065", "state": "California", "state abbreviation": "CA", "latitude": "34.0901"}]}

Once the Callout is complete, make sure the following values from the Response (see sample above) are properly assigned to the correct Flow Variables:

  • Place Name (the API service’s name for City)
  • State
  • State Abbreviation
  • Latitude
  • Longitude

As a final requirement, ensure that the information returned from this callout can be used in another Flow, if needed. 

HINT: The API Service will return your response as a collection.

Debug Instructions
Execute the Debug with the Lead Tanyau Patelf. Feel free to debug as many times as needed until you can successfully debug.

Submission Variables
NumberAnswer1 = Latitude
NumberAnswer2 = Longitude
TextAnswer1 = State
TextAnswer2 = Place Name (or City)

FlowFest V5 - Challenge 2 - Answer

1- Add an Action element and create a new HTTP Callout. Use Zippopotam as named credential. Participants got this named credential with the package that they installed.

Create new HTTP Callout

This API service receives variables from the URL. Add /{zip} to the URL path. Country (us) can be dynamic as well. However, to make it easier, we made the named credential work for USA only.

HTTP Callout Configuration

Then, copy and paste the sample response.

FlowFest V5 - Challenge 2 - Create HTTP Callout

2- Create two input variables. One text variable for zip code input and one for Lead record input. Then create a formula that returns the zip code input value if it is not blank. Otherwise, it should return the zip code of the Lead variable.

Zip Formula

3- Add an Action element to get the zip information.

FlowFest V5 - Challenge 2 - Get Zip Information

This action returns the information as a list. Therefore, add an Assignment element to assign the "places" output to an Apex-defined collection variable.

Assign Output of the HTTP Callout
Apex defined variable

4- Although there is only one output, it is still stored in a collection. Therefore, add Loop and Assignment elements to extract the output.

Use Assignment Element to Assign Outputs

5- For the submission variables of the challenge, convert latitude and longitude values to number.

FlowFest V5 - Challenge 2 - Latitude Value

At the end, your flow should look like this.

FlowFest V5 - Challenge 2

Submission Variables
NumberAnswer1 = 37.6754
NumberAnswer2 = -83.1871
TextAnswer1 = Kentucky
TextAnswer1 = Seitz

FlowFest V5 Challenges

Here are the answers of all the FlowFest V5 challenges.

1st Challenge
2nd Challenge
3rd Challenge

1 Comment

2 Trackbacks / Pingbacks

  1. FlowFest V5 Challenges - Challenge 3 - Salesforce Time
  2. FlowFest V5 Challenges - Challenge 1 - Salesforce Time

Leave a Reply

Your email address will not be published.


*