cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cdfulda
New Member

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
Highlighted
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


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

3 REPLIES 3
Highlighted
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


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

GarethPrisk Impactful Individual
Impactful Individual

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
cdfulda
New Member

Re: Display Multiple Alerts at Once

The gallery approach seems like the way to go.

Thanks!

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (8,377)