> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/scoped-notification/display-message-based-on-a-value.md).

# Display message based on a value

## Overview

In this use case, we demonstrate using the Avonni Scoped Notification flow screen component to validate age entry in a form. Specifically, we want to notify users if they are younger than 18, as they must be over 18 to apply. The scoped notification will only be displayed automatically when the specific criteria of being under 18 years old are met, providing a seamless and efficient way to ensure valid data entry in the form.

## **Guided Steps**

### 1️⃣ **Create Your Screen Flow and Add Component:**

Start by creating a new screen flow in Salesforce Flow Builder. Add a screen element and give it a name for easy identification later.

### 2️⃣ **Add and Configure the Avonni Scoped Notification Component:**

Search for the Avonni Scoped Notification component in the screen flow and drag it onto the canvas. Configure the component by setting its title, message, and notification type (success, error, or warning) from the Component Builder to match the desired user experience.

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

### 3️⃣ **Set Component Visibility Based on Specified Conditions:**

Go back to your screen flow, click on the component, and navigate to the **Set Component Visibility section** in the right-hand panel. Add the criteria that must be fulfilled for the notification to appear, ensuring the message is only displayed when it is relevant and meaningful.

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

## **Final Result**

This use case illustrates how the Avonni Scoped Notification flow screen component can be utilized to effectively validate data entry and notify users of specific criteria, in this case, age requirements, in a user-friendly and efficient manner.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/scoped-notification/display-message-based-on-a-value.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
