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 / Can't Patch collection...
Power Apps
Unanswered

Can't Patch collection that uses choice value

(0) ShareShare
ReportReport
Posted on by 242

So I have a collection named col_combined; there are nearly 50 rows in this, so for obvious reasons I will use the first row as an example of my issue.

 

col_combined

RatingScoreRatingTitle
1Access / Egress

 

the collection itself is fine - but I have a rather big Patch expression at the end of my app - for tidiness sake I have only included the the line related to "Access / Egress"

 

ForAll(col_actionRequired,
 Patch(
 'Form - Site Inspection Reports',
 Defaults('Form - Site Inspection Reports'),
 {
 'Primary Key': _formName,
 Name: _uploaderName,
 'Project Number': _projectNumber,
 Signature: signatureOutput.Image,
 'Problem Area': problemArea,
 'Action Required': actionRequired,
 'Have the changes been made?': "No",

 'Access / Egress': LookUp(col_combined, RatingTitle="Access / Egress").RatingScore
 }
 )
);

 

 

The whole expression is underlined in red and gives two messages:
- "The type of this argument 'gg_pub'accessegress' does not match the expected type 'OptionSetValue (Site Inspection Rating)'. Found type 'Text'.
- "The function 'Patch' has some invalid arguments.

 

I kinda understand the message, but don't actually understand what needs to be changed; I have pasted an image of the choice options in the table below - as well as this I think it might be worth mentioning that the value itself is taken from a dropdown (I'm about 90% sure that isn't necessary though)

JeckGill_0-1695135455397.png

 

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    @JeckGill 

     

    It's a Choice Column so You need to patch a Value as a record  means You need to Wrap Your lookup {Value:}

     

    ForAll(col_actionRequired,
     Patch(
     'Form - Site Inspection Reports',
     Defaults('Form - Site Inspection Reports'),
     {
     'Primary Key': _formName,
     Name: _uploaderName,
     'Project Number': _projectNumber,
     Signature: signatureOutput.Image,
     'Problem Area': problemArea,
     'Action Required': actionRequired,
     'Have the changes been made?': "No",
    
     'Access / Egress': {Value:LookUp(col_combined, RatingTitle="Access / Egress").RatingScore}
     }
     )
    );

      

  • JeckGill Profile Picture
    242 on at

    hi @SebS,

    unfortunately I got the same message - but with "Record" instead of "Text"

     

    "The type of this argument 'gg_pub'accessegress' does not match the expected type 'OptionSetValue (Site Inspection Rating)'. Found type 'Record'.

  • Michael E. Gernaey Profile Picture
    53,968 Super User 2026 Season 2 on at

    Hello,

     

    First off bless you for using the snippet feature.

    Is this a multi-select or single? 

     

    Let's say its single since it's a score. To patch a collection, you are essentially sending back a "record" pointer to the

     

    So in my example Table Rest(s), I created a column called 'Rest Choice' (yes my naming skills are LEGEND lol)

    Now in my UI for creating a new one, I put drop down, since its single choice.

    I set the items property to 

     

     

    Choices(Rests.'Rest Choice')

     

     

     

    Now when I go to Patch, I need to type the following to get that "record pointer" which is equal to the Selected.Value of my drop down.

     

     

    Patch(Rests, LookUp(Rests, Name = ""), { 'Rest Choice': DropdownCanvas1.Selected.Value });

     

     

    So in your collection you need the value to be equal to what I have above.

     

    If its a multi-choice then you want the following 

     

    Patch(Rests, LookUp(Rests, Name = ""), { 'Rest Multi Choice': ComboboxCanvas1.SelectedItems });

     

     

    For strings only you do this

    Patch(Rests, LookUp(Rests, Name = ""), { 'Rest Choice': LookUp(Choices(Rests.'Rest Choice'), Text(Value) = "My Text Value").Value });


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • JeckGill Profile Picture
    242 on at

    Hi @FLMike,

     

    I don't get what example you are referring too.

    However yes it is only single choices in my app - one of them is as below:

    JeckGill_0-1695137077896.png


    When I selected "next page" on this, it adds these 4 to their own clear_collection, then on a later page all my collections get clear collected together to create one larger collection of about 49 rows. This way allows for updating everytime the user goes forward and backwards across pages - which is why I've gone for the kind of unorthodox way of using a lookup on a collection rather than using the dropdown value itself 

  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    @JeckGill 

     

    I maybe wrong but Your Schema is Label and Value so the same Schema is expected Label and Value  are same so maybe you could try :

     

    ForAll(col_actionRequired,
     Patch(
     'Form - Site Inspection Reports',
     Defaults('Form - Site Inspection Reports'),
     {
     'Primary Key': _formName,
     Name: _uploaderName,
     'Project Number': _projectNumber,
     Signature: signatureOutput.Image,
     'Problem Area': problemArea,
     'Action Required': actionRequired,
     'Have the changes been made?': "No",
    
     'Access / Egress': {
     Label:LookUp(col_combined, RatingTitle="Access / Egress").RatingScore.
     Value:LookUp(col_combined, RatingTitle="Access / Egress").RatingScore}
     }
     )
    );

     

  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    @JeckGill 

     

    I feel Dumb now 😛 the Choice Column is Dataverse Choice Column and There is totally different approach to patch them.

  • Michael E. Gernaey Profile Picture
    53,968 Super User 2026 Season 2 on at

    I put an example in for him lol but I do sillly stuff non stop hehe

  • Michael E. Gernaey Profile Picture
    53,968 Super User 2026 Season 2 on at

    However you are capturing

    Value,

    String

    Multi

     

    The examples will show you. But since you use a collection you need to pull out the proper thing from there, based on how you stored it.

  • JeckGill Profile Picture
    242 on at

    JeckGill_0-1695141847930.png

    I was about to say, new underline 😅

  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    @JeckGill @FLMike 

     

    in Theory if I did not make any mistakes in data Source name and choice Field name this should work

     

     

    ForAll(col_actionRequired,
     Patch(
     'Form - Site Inspection Reports',
     Defaults('Form - Site Inspection Reports'),
     {
     'Primary Key': _formName,
     Name: _uploaderName,
     'Project Number': _projectNumber,
     Signature: signatureOutput.Image,
     'Problem Area': problemArea,
     'Action Required': actionRequired,
     'Have the changes been made?': "No",
    
     'Access / Egress': LookUp(Choices('Form - Site Inspection Reports'.'Site Inspection Rating'), Text(Value) = LookUp(col_combined, RatingTitle="Access / Egress").RatingScore
     )
     
     }
     )
    );
    

     

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard