# Enabling auto-refresh for queries after the Flow Dialog ends

## Overview

This tutorial shows how to refresh queries after a flow dialog finishes automatically. Doing so, updates data sources immediately, improving accuracy and the user experience.

Because the standard Salesforce navigate interaction to an object page is used to create new records, it doesn’t automatically refresh Avonni Components configured with a Query Data Source (such as Data Table). This guide ensures those components update to include newly created data as soon as the dialog closes.

<figure><img src="/files/rSrJUOVqFFHEouDPx79P" alt=""><figcaption><p>Final result</p></figcaption></figure>

{% hint style="info" %}
This tutorial is designed to work specifically with Avonni Components with integrated [Query Data Source](/flow/component-builder/data-sources/query.md).
{% endhint %}

## Step-by-Step guide

### **Step 1: Integrate Query Data Source**

* Click the "Open Component Builder" to access all the component settings.
* Start by incorporating the Query Data source in the Avonni Components into your Salesforce Flow.

{% hint style="warning" %}
To finish this tutorial, ensure you use the [Query Data Source](/flow/component-builder/data-sources/query.md) with your component.
{% endhint %}

### **Step 2: Configure Your Query**

Customize your query parameters to suit the data you wish to retrieve and manipulate.

### **Step 3: Initiate Action Creation**

Create an action button or a row action. This will be the user's entry point for triggering the flow.

### **Step 4: Access the Interaction Panel**

Navigate to the interaction panel to set up the flow's interactive elements.

<figure><img src="/files/wp68w6CXVLnH8bYZw6RP" alt=""><figcaption></figcaption></figure>

### **Step 5: Create an Interaction**

Proceed to create a new interaction that will act upon the action button or menu you've just made.

### **Step 6: Define the Interaction Target**

Assign the previously designed action button or menu (from step 3) as the target for this interaction.

<figure><img src="/files/pOpknVFOwpSzPcvQkMjc" alt=""><figcaption></figcaption></figure>

### **Step 7: Choose Interaction Type**

For the interaction type, opt for "Open Flow Dialog," which prompts a new flow to open upon activation.

<figure><img src="/files/NjZbwsrGpgZiw3BjBv9V" alt=""><figcaption></figcaption></figure>

### **Step 8: Select the Desired Flow**

Identify and select the particular flow that this interaction should launch.

### **Step 9: Assign Input Variables**

If necessary, relay any required input variables to the flow that is being opened.

{% hint style="info" %}
**Related**: [How to pass an input variable from one flow to another](/flow/tutorials/interactions/how-to-pass-an-input-variable-from-one-flow-to-another.md).
{% endhint %}

### **Step 10: Configure 'On Finish' Interaction**

After setting up the main flow, click the "On Finish" button to define what happens once the flow concludes.

<figure><img src="/files/HXDDtIcTjg3vomFw8qDN" alt=""><figcaption></figcaption></figure>

### **Step 11: Set 'On Finish' Interaction Type**

For the 'On finish' interaction, select "Refresh Query." This ensures that your query automatically updates when the flow dialog ends.

<figure><img src="/files/LPfeBWxnHeyPsPr3ViTh" alt=""><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/Wa7k5I4dkbQ>" %}

**Conclusion:** With these steps completed, your Salesforce Flow is now equipped to refresh queries automatically, streamlining your processes with Avonni Components. This function is pivotal for maintaining current information flow throughout your Salesforce environment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/flow/tutorials/interactions/enabling-auto-refresh-for-queries-after-the-flow-dialog-ends.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
