Skip to main content

6. Adding Inputs and Outputs

In this section, we will add the arguments (inputs and outputs) to the function we created in the previous section. In our case we want the function Get City And State From Zip to take a ZIP code as input and return the city and state for that ZIP code. In our recorded flow, the ZIP code used was 10001 and the city and state returned was NEW YORK, NY.

Adding the Input

There are many ways to add arguments to a function, for adding the input we will use the + Add New Input button in the bottom panel of the function tab.

Add Input

Once we have created the input, we can name zipCode and search and select the refrence value 10001 in the "Select input value reference" dropdown.

Add Input

Once we have done this, we can see that the input is now visible in the function tab and mapps to exchange 0010.

note

One thing to note when working with inputs is that they will override any variables refrencing the same value. If we for example created a variable with the refrence value ffffffff3b462a2245525d5f4f58455e445a4a4212d3 (the same as the nscUppmtUsvfOfxCookie variable), the variable would sieze to exist and the exchange 0010 would now get this value from the input instead. Read more about this in the Variable & Argument Prioritization section.

Adding the Outputs

The outputs could be added in the same way as the inputs, but in this case we will go a different route just to show the different ways to add arguments. We will first search for the values we are interested in, NEW YORK and NY in the function tab. We open the search bar by pressing Ctrl + F (Windows/Linux) or ⌘ + F (macOS) or pressing the search button in the top right corner of the function tab. Once this is open, we can start searching for NEW YORK:

Search Output

We can see that we got multiple hits for NEW YORK, but the one we are interested is the first one. We can click it to be taken to the exchange where it is found, we can then right-click the value and select Add as function output, alternatively we can press Add as function output button in the bottom right corner of the exchange properties pane.

Add Output

We can now rename the output to city like we did with the input.

Rename Output

note

When you add an output this way, the output will automatically have a "custom source" set to the exchange where the value was found. This is useful if you have multiple places where this value is found and you want to specify exactly where it should come from. If this is not important, you can remove the custom source by toggling the switch in the output properties pane.

For the state NY we can do the same thing, search for NY and add it as an output. Leaving us with the function tab looking like this:

Final View