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 / Does not match expecte...
Power Apps
Unanswered

Does not match expected type

(0) ShareShare
ReportReport
Posted on by 11

Hi! Its day 1 of power apps for me!

 

I'm creating an app for data entry, which is connected to sharepoint lists. The majority of the fields are intentionally 'required'. 

 

To create a new record/row I used the patch function as follows:

 

Screenshot 2023-07-30 1520311.png

The following error message pops up: The type of argument "ProductType" does not match the expected type "Record"

In this case, "ProductType" column is a record - how do I call a record function? 

 

Similarly, I would need to do the same for another column called Block Number, which currently finds type as text, but should be converted to number. How do I go about this?

 

 

Categories:
  • elseb Profile Picture
    774 Moderator on at

    Hi,

     

    to convert text to number use Value("text"),

    as for the other one, you can format the patch value into a record but before that could you please let me know what type column your productType column is?

     

    Seb

  • Shane5 Profile Picture
    11 on at

    Thanks Seb - Value ("text") works well.

     

    productType is a record column which contains text choices such as:

    - Old 

    - New

     

    Let me know how best works to format the patch value into a record?

  • elseb Profile Picture
    774 Moderator on at

    Hi, 

     

    If i can give you advice based on my experience now which will save you some headache later: try to avoid using those specialised columns like choice column, use number column instead, e.g. if your product type column is number you can set number to each type, eg 0 for old, 1 for new etc. then when displaying ou can do if(thisitem.product_type = 0, "New",thisitem.product_type = 1, "Old") etc. this way in future if you ever decide to change the name of the type, your old records will be updated, I've learned awhile ago not to  hardcode any values ever.

     

    on top of that to make it easier to manage the names i use formulas to store reference tables for id and display name of the item but that's a story for another time I guess 🙂

     

    Seb

  • Shane5 Profile Picture
    11 on at

    Thanks Seb, but in the meantime is there a solution to handle Records?

  • elseb Profile Picture
    774 Moderator on at

    {productType: {Value:"New"}}

  • Shane5 Profile Picture
    11 on at

    Thank you!

  • elseb Profile Picture
    774 Moderator on at

    No worries 🙂

    If you don't mind please mark the post that resolved your question.

     

    Seb

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard