Using Inputs and Outputs in Connector Functions

hello all,

for Connector Functions to be effectively used, information needs to be sent/received from the Function to the App. in Tulip, we do this using Inputs and Outputs.

to learn this, we’ll be building the following app that gets all stocks listed on the NY stock exchange and gets the last price when a row is selected:
Screen Recording (1)
.

  1. create a function to get all symbols by creating a function that hits the following endpoint: https://api.iextrading.com/1.0/ref-data/symbols.
    pay close attention to the Output, you will see that it’s an Array of Objects, containing all the information we’re interested in extracting:

  2. on a Button click add the Run Connector Function Action and store the Output in a Variable:

  3. display the returned Output in the App as an Embedded Table:

  4. add a Trigger to run a 2nd Connector Function to get the last price when a row is selected. because our Connector Function has an Input, in the Trigger Action we’re promeed to enter the input (symbol).
    Trigger on Row Selected:


    Connector Function where the endpoint is: https://api.iextrading.com/1.0/tops/last?symbols=$symbol$. please note that by entering $'s, the Input can be used in your call):

and that’s it!! let me know if you have any thoughts or questions!!