cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cdfulda
Level: Power Up

Display Multiple Alerts at Once

I'm attempting to create a button that I want to, upon receiving the response from my flow, iterate through an array of notifications I have contained in the response and display a separate banner alert for each that will all show up and be visible at the same time. The returned array has types and messages mapped to each notification, and I map the notification type index to Information, Warning, or Error depending.

My current loop looks like this:

ForAll(response.NotificationResponse.Notifications, Switch(Type, 0, Notify(Message, NotificationType.Information), 1, Notify(Message, NotificationType.Warning), 2, Notify(Message, NotificationType.Error)));

My loop works properly, but as I iterate through the array, the next notification always overrides the last, meaning that only the last item in the array is ever actually displayed . I haven't been able to figure out a way to get all the notifications to show up at once, rather than each one overriding the one before it.

Is this possible? Or am I going to need to concatenate all my notifications into one message body and display it as a single alert type?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Display Multiple Alerts at Once

Hi @cdfulda 

 

Notifications will always overlay along the same area so you won't be able to have multiple shown on one screen.

 

I would suggest to either do as you said and concatenate into one message, or you have a gallery whose items are a collection of the items returned from the flow) and these then 'look' like notifications, then have the 'x' within each row do a remove() for that row from the collection. This would allow you to overlay multiple messages underneath each other and to have them be individually dismissed.

 

Let me know if that helps,

 

Cheers,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Display Multiple Alerts at Once

Hi @cdfulda 

 

Notifications will always overlay along the same area so you won't be able to have multiple shown on one screen.

 

I would suggest to either do as you said and concatenate into one message, or you have a gallery whose items are a collection of the items returned from the flow) and these then 'look' like notifications, then have the 'x' within each row do a remove() for that row from the collection. This would allow you to overlay multiple messages underneath each other and to have them be individually dismissed.

 

Let me know if that helps,

 

Cheers,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

View solution in original post

GarethPrisk
Level 8

Re: Display Multiple Alerts at Once

I agree with the Gallery approach.

  • Create a Gallery (galAlerts) based on a collection (colAlerts)
  • When an Alert is needed, add a record to the collection
  • Set the Gallery as read-only (disabled)
  • Place the Gallery as the top-most item on the screen (by Y coordinate, and layer)
  • Set the visibility for the Gallery
    • If(CountRows(colAlerts)>1, true,false)
  • Set the height of the Gallery
    • CountRows(colAlerts) * (galAlerts.TemplateSize + galAlerts.TemplatePadding)
  • Have a mechanism to remove Alerts (rows from Collection/Gallery)
    • For a row in the gallery, add an OnSelect icon or similar control
    • Remove(colAlerts,ThisItem)
  • Have a mechanism to remove all Alerts (i.e. Clear(colAlerts)
  • Make the alerts contextual
    • Color-coding, icons, etc. to differentiate the type of Alert
Highlighted
cdfulda
Level: Power Up

Re: Display Multiple Alerts at Once

The gallery approach seems like the way to go.

Thanks!

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,780)