Variable

The Variable Data Source lets your Avonni Data Component tap directly into your Salesforce Flow. It's like a dynamic pipeline, allowing your component to display information collected, calculated, or modified throughout the Flow's execution.


How It Works

Store Contact Details

Use a "Get Records" element or a record collection variable in your Salesforce Flow to retrieve the contact information you want to display (e.g., name, email, phone). Store this data in a record collection variable.

In your Avonni List Component settings, select "Variable" as the source and choose the record collection variable where you stored the contact details.

Map the Fields

Connect the contact fields from your variable to the corresponding elements in the Avonni List Item. For example:

  • Connect the "Name" field to the "Title" attribute of the Avonni List Item.

  • Connect the "Email" field to the "Description" attribute to display it below the name.

  • Consider using the "Avatar" attribute to display the contact's picture.


Types of Flow Variables

In Avonni, you can use these types of Flow variables to display data in your components:

Get Records Element Output

This holds a group of Salesforce records, like a list of contacts or accounts, retrieved using the "Get Records" element in your Flow. This is perfect for displaying tables or lists of information using Avonni components like the List or Data Table.

Custom Variables (Output of Transform Elements)

If you're using a Transform element in your Flow to manipulate data, the output is a custom variable you can use with Avonni components.


Example: Order Summary

Imagine a Flow where the user selects products and quantities. You can use a Variable Data Source to display a summary of their order on a later screen:

  1. Store the product details and quantities using the Get Records element in a collection variable.

  2. Add an Avonni Data Table on the summary screen and choose "Variable" as the Data Source.

  3. Select your collection variable.

  4. The Data Table will dynamically display the user's order, updating if they make changes in previous steps.


Tips

  • Variable Scope: Consider variable scope to ensure your chosen variable is available when the component needs access.

  • Data Types: Make sure the variable's data type is compatible with the Avonni Data Component you're using. For example, a Data Table expects a collection variable, while a Text component expects a single-value variable.

  • Variable Naming: Use clear and descriptive names for your variables to make your Flow easy to understand and maintain.

Last updated