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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Email based on gallery...
Power Apps
Answered

Email based on gallery items

(0) ShareShare
ReportReport
Posted on by 583

Hello all,

 

I wonder if this is even possible? I have a gallery that consists of Contacts, Emails Addresses, a count based on that information, and a boolean also based on that information. I'm wanting to create a button that looks at the boolean Body5_1, and evaluates that for each gallery item. If it is true in a gallery item I would like to send an email to the email address in that gallery item using the other data in the gallery item.

 

If(Body5_1.Text="true",Mail.SendEmailV3(ThisItem.EmailAddress,"Support Contacts","Hello "&ThisItem.Contact&",<br><br> You have "&Body5.Text&" support contacts this week.<br><br>Thanks.",true))

 

But this will only send the email to the first item in the gallery not each and every one.

 

Any ideas on how to make it send an email to each gallery item?

 

Thanks,

Stephen

Categories:
I have the same question (0)
  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @StephenGW If you want to send emails to all items in the Gallery, you have to loop through the gallery using a ForAll() loop. Try the following formula,

    ForAll(youGallery.AllItems(),If(Body5_1.Text="true",Mail.SendEmailV3(ThisItem.EmailAddress,"Support Contacts","Hello "&ThisItem.Contact&",<br><br> You have "&Body5.Text&" support contacts this week.<br><br>Thanks.",true)))

    Replace youGallery with the name of your Gallery.

    Also, one thing that's not clear is what control is Body5_1? Is it a text input? If you want to display Boolean values, a checkbox would be better. Hope this helps.

  • StephenGW Profile Picture
    583 on at

    @CNT 

     

    That worked perfectly! Body5_1 is a text box with a formula in it to see if a count is higher than a set number.

     

    Thank you for the solution and quick reply!

    Stephen

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @StephenGW Glad to help !😊

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard