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 Apps / How to send email usin...
Power Apps
Answered

How to send email using collection excluding blank values

(0) ShareShare
ReportReport
Posted on by 23

Hi All. I have a collection (and a gallery) that contains values for various data points. Each row in the collection will not have a value for every column. How can I send an email using the collection (or the gallery) that will only send non-blank values?

 

The canvas app addresses employee status changes. An entry could include a change to a department, salary adjustment, title, manager, etc. An initial dropdown drives the available selections. If the user selects Department from the Change Type dropdown, they are presented with options to change the department, effective date and a text field. If instead of Department they select Salary Adjustment, the user is presented with options of Current Rate, New Hourly Rate, Bill Rate and Multiplier. Rinse and report for each item within the Type of Change dropdown. The selected changes are added to a collection that populates a gallery. Multiple Change Types can be added to the gallery, for example if someone has their title, department and manager changed.

 

I'd like to send an email that only includes the changes the user has selected. For example, if a user selected to change their title, I want to exclude items associated to the salary adjustment options, instead I would like the salary adjustment options to be omitted from the email because they are irrelevant to the request.

 

As it stands, I'm using the Concat command on the collection and it includes all fields from the collection. Any help is greatly appreciated.

Office365Outlook.SendEmailV2(
"email@email.com",
"Employee Status Change",
"A status change for <b>" & EmployeeName_3.Selected.DisplayName & "</b> has been received.<br><br>
The request was submitted by <b>" & User().FullName & "</b> on <b>" & Now() & "</b>.<br><br>"&
"<b><u>THE CHANGES:</b></u>" &
Concat(
BulkChanges,
"<br> Effective Date: <b>" & EffectiveDate & "</b><br> Change: <b>" & TypeOfChange & "</b><br> New Manager: <b>" & NewManager & "</b><br> New Department: <b>" & NewDept & "</b><br> New Classification: <b>" & NewClassification.Value & "</b><br> Current Rate: <b>" & CurrentRate & "</b><br>New Hourly Rate: <b>" & NewHourlyRate & "</b><br> New Bill Rate: <b>" & NewBillRate & "</b><br> Multiplier: <b>" & NewMulti & "</b><br> Offboard Type: <b>" & OffboardType & "</b><br> M2M License: <b>" & M2mLicense & "</b><br> New Location: <b>" & RelocationPlace & "</b><br> New Title: <b>" & NewTitle & "</b><br>Explanation: <b>" & Notes & "</b><br><br>"
) &
"Regards,<br>"
& User().FullName,
{
Bcc:"imwatching@email.com",
Importance: "High"}
)

 

Categories:
I have the same question (0)
  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @john4 

     

    Would something like the following work?

     

    If(IsBlank(EffectiveDate),"","<br> Effective Date: <b>" & EffectiveDate & "</b>")

     

    Damien

  • john4 Profile Picture
    23 on at

    Thanks bud, that works! Take care.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard