Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Answered

Notification Banner in Power Pages

(0) ShareShare
ReportReport
Posted on by 53

Hi Team,

 

I aim to display notification banners (alert messages) on each form of the Power Pages. To achieve this, I plan to utilize a table within Dataverse to capture notification messages along with their corresponding start and end dates. The columns of the Notification Dataverse table include:

1. Message
2. From (start date)
3. To (end date)
When the current date satisfies the conditions specified by the From and To dates, the notification message from the Notification Dataverse table will be displayed.

Has anyone implemented a similar requirement before? If so, could you please share the approach and any relevant code if possible?

 

Thanks! 

Categories:
  • Verified answer
    domliu37 Profile Picture
    314 Super User 2024 Season 1 on at
    Re: Notification Banner in Power Pages

    Hi @Sandeep009 ,

     

    I would probably do everything on the web template, yo ucan create a new web template and add that to each individual web template contains your target forms

    1. Fetch Query to get the message from your custom Notification table, based on the date
    2. display the alert just using the JS alert function. (not sure how do you want to display the alert message, this is just what i would do)

     

    fyi, your fetch query would be something like:

    {% fetchxml messagefetch %}
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="dom_notification">
    <attribute name="dom_message" />
    <filter type="and">
    <!-- your conditions --!>
    </filter>
    </entity>
    </fetch>

    {% endfetchxml %}


    then to retrieve the message:
    {% for message in messagefetch.results.entities %}
    {% assign messageContent= message.dom_message %}

    hope that will give you a good starting point
    ----------------------
    If you enjoy this post, click the thumbs-up button. If it helped you, mark it as a solution so others can find it easily.

    Cheers,
    Dom

  • Verified answer
    fm_skeller Profile Picture
    277 Super User 2025 Season 1 on at
    Re: Notification Banner in Power Pages

    I have implemented this by using adding a webtemplate. The webtemplate uses a {%fetchxml%} liquid tag that contains the fetchxml to select the messages that apply. I then use the toastr.js library (toastr examples (codeseven.github.io) to display a toast message for each of the results. Of course you shouldn't use toastr if you have a lot of messages - then it's better for the user experience to just display a table on the start page. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43