Refresh Response in Action flows

Now when you use the Action flow and add any of the DB connectors or the Global APIs you can have scenarios where you need to pass dynamic values to the query to fetch data. For some of these you will notice that you do get the global data and the Keys specific to your account are not available to bind to your controls.

However, you now have the option to use Refresh Response in Action Flow. When you enter the test value and click Refresh Response, the response would be based on the dynamic variables and the keys that are generated would be used to add output variables. It enables you to reduce the complexity that arises for such APIs where keys are generated after dynamic values are provided. It is also important to note that the values that are generated can now be returned using the Output variables.

So now let us take an example to fetch data from an Airtable database. Let us consider a Marketing table which contains data about the Marketing team members, the number of calls made by each of them, and the team they belong to. We want to find the sum of the calls made by the teams of a particular region that would be selected from a Dropdown menu.

In this case we want to use the Airtable connector to get data from the Airtable table based on the regional team provided dynamically. So in the action flow select the Server-side actions and choose the Airtable connector. Select the connected account. You can refer to the Airtable Connector article for more information on connecting to an Airtable account. In this case, the Airtable Connector’s Find rows action is what would help you fetch data for the selected table. It will get all the rows where the Team is as selected. That being the first step you also need the sum of the calls made by the entire team from the CallsMade column.

When configuring the connector fields you are providing the value of the dropdown control for choosemarket as the dynamic value. Now if you see the raw response you have no key values available.

So if you click Refresh Response then you would see that the data is fetched for a particular Market that is temporarily added here.

If you click Refresh Response, you would get the specific output for the Team. Click Continue. It is just the rows where the team is as per selected. So when you run this connector you need to return these values fetched for the CallsMade column so that a compute block can be used to help you to use the SUM function to get the total of the CallsMade.

Now add a Compute block and use the sumofcalls return value from the connector.

You can use the SUM function in the Compute block but not in the Connector earlier. So here you now have the total calls made by the entire team for the region selected. You can use the value in any JSCode or even a simple PopUp or toast block as needed. In this example, we have used a PopUp that shows the Sum.

So now when you run this form you can see that the Sum is displayed for the above select Market/team.

Refresh Response enables you to make use of the Connector values within the Action flow and make use of the value for any further complex actions. It enables you to provide the dynamic values for the Connectors like Airtable, Open APIs and so on where the Keys are not always available.