Introduction to universal connectors exercise

Expand your understanding of working with REST universal connectors and working with the data returned.

Exercise overview

Using a Pokemon character in a spreadsheet, call the Poke API through an HTTP connector to gather and post more information on that character.

Introduction to universal connectors Image 1

Steps to follow

Download the CSV file from Workfront.

  1. In the Workfront “Fusion Exercise Files” folder, select “_Fusion2020_Shipping Manifest.csv” and click Document Details.

  2. Copy the first ID number from the URL address.

  3. Create a new scenario in Workfront Fusion. Name it “Using universal connectors.”

  4. Start with the Download Document module from the Workfront app.

  5. Set up your Workfront connection and include the Document ID you copied from the Workfront URL.

  6. Rename this module “Download shipping manifest.”

    Introduction to universal connectors Image 9

    Parse the shipping manifest data.

  7. Add another module, selecting Parse CSV.

  8. Set up Parse CSV for 11 columns. Check the CSV contains headers box. Choose the Comma delimiterType, and put Data from the Download Document module in the CSV field.

    Introduction to universal connectors Image 2

  9. Rename this module “Parse shipping manifest.”

  10. Save the scenario and click Run once so you can see data from the CSV file in the next steps.

    Get the Pokemon data using the universal connector.

  11. Add an HTTP Make a Request module.

  12. In the URL field use https://pokeapi.co/api/v2/pokemon/[Character], where [Character] is mapped to Column 3 from the Parse CSV module.

  13. Select the Parse response check box.

  14. Select Show advanced settings and then check the box next to “Evaluate all states as errors.”

  15. Click OK and rename the module “Get Pokemon info.”

    Your mapping panel should look like this:

    Introduction to universal connectors Image 3

    In this part of the exercise, you only want to process row 1 in the CSV file.

  16. Add a filter before your Get Pokemon info module. Name it “Only row 1.”

  17. Set the condition to only allow ID number 1 to pass. ID number 1 is in row 1, and the ID field is in Column 1 in the CSV file.

    Introduction to universal connectors Image 4

  18. Save the scenario.

  19. Click Run Once and observe the error message you receive in the HTTP Make a request module.

    note important
    IMPORTANT
    Notice in the input data URL field the character name is capitalized. This won’t work for making that API call because character names need to be lowercase.

    Introduction to universal connectors Image 5

  20. Use the mapping panel in the HTTP Make a request URL field to make the [Character] field all lowercase letters using the lower function.

    Introduction to universal connectors Image 6

    Map information back from the API using the Set multiple variables module.

  21. Add the Set multiple variables module after Get Pokemon info. Map name, height, weight, and abilities.

  22. Since the Abilities field is an array, remember to use the map function to access the name of each ability in the array.

    Introduction to universal connectors Image 7

    Run the scenario without the filter to uncover another error.

  23. To process all the rows in the CSV file, delete the filter named Only row 1:

    • Click the filter icon to edit it.
    • Delete the filter label.
    • Delete the Condition.
    • Click OK.
  24. Save the scenario and click Run once.

  25. An error occurs in the Get Pokemon info module. You see a superhero character has been passed to the Pokemon API.

    note note
    NOTE
    In the Routers walkthrough, you’ll see how to resolve this error by creating a separate path to process superheroes.

    Introduction to universal connectors Image 8

recommendation-more-help
c9fbcf61-6d19-481e-a9ab-f54a0ae0ee8a