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 Gallery and send...
Power Apps
Answered

Email Gallery and send to SharePoint List. Fix 'Record' arguement

(0) ShareShare
ReportReport
Posted on by 14

I'm trying to accomplish a couple of things in my "shopping cart" app. One, is to email a collection, a few text input fields, a date picker, and a dropdown. Two, I also want to share all this information to a SharePoint List (Orders_1).

screenshot1.PNG

The formula for my Collect:

collectionformula.PNG

 

My collection (CollectOrders) has the following fields: Title (Customer), Product, Package, Qty, Notes

The 'Product' column is a table (ProductGallery) and this is where I think my issue is coming from. Do I need to Patch this Gallery by using the Rename function? Use the ForAll function? Or do I need to use some sort of HTML text boxes?

Here's the formula I was trying to use when sending my collection to SP and email:

emailformula2.PNG

 

This resulted in an error in the 'Product'  line reading:

Invalid argument type. Expecting one of the following: Text, Number, Boolean, OptionSetValue, ViewValue

I also have two errors with the Collect function:

The function 'Collect' has some invalid arguments.

Incompatible type. The 'Product' column in the data source you're updating expects a 'Text' type and you're using a 'Record' type.

 

I've tried using the ForAll function, but this sends multiple emails and is not working with my SP. I hope you wonderful PowerApps wizards out there can help this novice. Thank you.

Categories:
  • WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @Maurice_97 , Your syntax of the code below is fine except for the line "Date: " & Date & Char(10) .
    Date is a reserved function word in PowerApps (see this article). So try this.

    ClearCollect(
     Orders_l,
     RenameColumns( 
     CollectOrders,
     "Date",
     "DateX" //Whatever name you want
     )
    ); 
    Office365Outlook. Send Email( 
     "msomarriba@huntnsons.com", 
     "Subject", 
     Concat(
     CollectOrders, 
    	 "Customer Name: " & Title & Char(10) & 
    	 "'Product:" & Product & Char(10) & 
    	 "Package: " & Package & Char(10) & 
    	 "Qty: " & Qty & Char(10) & 
    	 "Date: " & DateX & Char(10) & 
    	 "Notes: " & Notes & Char(10)
     )
    )

    This will eliminate one possible issue. The second issue you mention is Product. What type of field is this in your data set?

     

    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.

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Maurice_97 ,

    Firstly, I suggest you not use field named Date in your list like he said @WarrenBelz .

    This may lead to ambiguity.

    Try other fieldname in your collection and list to replace Date field.

     

    Secondly, could you tell me

    1)the fields' data type in your list?

    2)the structure of ProductGallery's Items? 

    3)which column in ProductGallery's Items represent product and the column data type?

    Based on your screen shoots, maybe the ProductGallery's Items is CollectOrder collection.

    Then "ProductGallery.Selected" will represent a record.

    If Product field in your list is text type, then you insert wrong data type to Product field.

    I assume that ProductName field is Product value in ProductGallery's Items and its data type is text.

    Then try this formula:

    Collect(ProductOrder,{Product:ProductGallery.Selected.ProductName,.....})

     //"ProductGallery.Selected.fieldname" should be the same data type of Product field.

     

     

    Best regards,

  • WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Hi @Maurice_97 ,

    @v-yutliu-msft and myself are both heading in the same direction (the reason for my second question).

    Please tag whichever approach is best for you to continue this thread with.

  • Maurice_97 Profile Picture
    14 on at

    @WarrenBelz 

    The 'Product' field is a Single Line of Text field in SP and it's a 'Record' in the apps Collections:

     

    2020-03-04 (2).png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Also denoted as 'Cart':

     

    2020-03-04 (3).png

    I tried making the adjustments you suggested, but now I'm getting an additional error concerning the "DateX" modification:

     

    2020-03-04 (1).png

  • Maurice_97 Profile Picture
    14 on at

    @v-yutliu-msft 

    1)The data type I'm trying to email or sent to a SP list is a Collection within PowerApps (CollectOrders). In SP this data would be inputted into a single line of text field.

    2)The items in the ProductGallery are from an Excel table (ProductList1) connected via OneDrive. Formula for the Gallery:

    2020-03-04 (5).png3) After the 'Product' is selected in the Gallery it is then represented in Textinput6. 

    2020-03-04 (6).png

    At this point the data is 'Collected' via this formula:

    2020-03-04 (7).png

  • Verified answer
    WarrenBelz Profile Picture
    156,545 Most Valuable Professional on at

    Ok @Maurice_97 ,

    Try this (a step closer anyway)

     

    ClearCollect(
     Orders_l,
     RenameColumns( 
     CollectOrders,
     "Date",
     "DateX" //Whatever name you want
     )
    ); 
    Office365Outlook. Send Email( 
     "msomarriba@huntnsons.com", 
     "Subject", 
     Concat(
     CollectOrders, 
    	 "Customer Name: " & Title & Char(10) & 
    	 "'Product:" & Product.Product_x0020_Name & Char(10) & 
    	 "Package: " & Package & Char(10) & 
    	 "Qty: " & Qty & Char(10) & 
    	 "Date: " & DateX & Char(10) & 
    	 "Notes: " & Notes & 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.

     

     

  • Maurice_97 Profile Picture
    14 on at

    @WarrenBelz; @v-yutliu-msft 

    Yes! Part of the solution worked:

    2020-03-04 (8).png

    Here is what my SharePoint fields look like. I renamed the 'Date' field to 'DateX':

    2020-03-04 (9).png

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard