web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Notification Banner in...
Power Pages
Unanswered

Notification Banner in Power Pages

(0) ShareShare
ReportReport
Posted on by 67

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:
I have the same question (0)
  • Verified answer
    fm_skeller Profile Picture
    277 Moderator on at

    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. 

  • Verified answer
    domliu37 Profile Picture
    314 Super User 2024 Season 1 on at

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard