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 / Sending a collection a...
Power Apps
Answered

Sending a collection as an email which includes drop down and dates

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I am trying to link my collection "Expenses" into my email so that it sends with other information. However it keeps on coming up with an error message. I think it is because some of the fields in my collection are drop downs and one is a date and I think it only accepts texts/variables. Is there a way to convert my collection so that it works with sending emails? 

This is my current code for the OnClick of a button. The fields are Column, Cost, CustomerNo, Date and Description. Column is a drop down field which the user selects and date is a date selection

 

email_outlook.SendEmail(lbl_emailto1,lbl_subject1,Concat(Expenses, "Column:" & Column & Char(10)& "Cost: " & Cost & Char(10) & "Customer Number: " & CustomerNo & Char(10) & "Date: " & Date & Char(10) & "Description: " & description & Char(10)))

 

Any help would be massively appreciated 🙂

 

Thanks, Emma

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,972 Most Valuable Professional on at

    Hi @Anonymous ,

    You may need something like the below

    email_outlook.SendEmail(
     lbl_emailto1,
     lbl_subject1,
     Concat(
     Expenses, 
     "Column:" & Column.Value & Char(10) & 
     "Cost: " & Cost & Char(10) & 
     "Customer Number: " & CustomerNo & Char(10) & 
     "Date: " & Text(Date, "dd/mm/yyyy") & Char(10) & 
     "Description: " & description & Char(10)
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    155,972 Most Valuable Professional on at

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, thankyou for the reply.

    The email section of it works, however it only loops through the first section of my collection. For example, I have answered my sections all differently, but it has sent me this as an email:

    Column:Motor Fuel

    Cost: 5

    Customer Number: AB1234

    Date: 03/05/2022

    Description: Fuel for my car

    Column:Motor Fuel

    Cost: 5

    Customer Number: AB1234

    Date: 03/05/2022

    Description: Fuel for my car

    Column:Meals

    Cost: 10

    Customer Number: AB1234

    Date: 03/05/2022

    Description: Fuel for my car

    As you can see it just repeats the first column instead of moving onto the next. When I look at my collection in "view" and in my connected galleries it all seems to work fine?

    Any help massively appreciated 🙂

    Emma

  • WarrenBelz Profile Picture
    155,972 Most Valuable Professional on at

    Hi @Anonymous ,

    The code should not do that if all those items are different in Expenses. What do you see when you View > Collections > Expenses

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    When I click view, collections, expenses: all of the different rows are different according to how I inputted it earlier however when it emails it just repeats the first row. 

  • WarrenBelz Profile Picture
    155,972 Most Valuable Professional on at

    Hi @Anonymous ,

    I am perplexed at that result as this is a simple Concat string that simply should work. I will make one small tweak assuming Amount is a number, but other than that, I cannot reproduce your result using the same code

    Concat(
     Expenses, 
     "Column:" & Column.Value & Char(10) & 
     "Cost: " & Text(Cost,"$##,##0.00") & Char(10) & 
     "Customer Number: " & CustomerNo & Char(10) & 
     "Date: " & Text(Date, "dd/mm/yyyy") & Char(10) & 
     "Description: " & description & Char(10)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard