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 / Patch Choice Field Not...
Power Apps
Unanswered

Patch Choice Field Not Working

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to patch to a SharePoint List with a Choice Column. It works throughout the rest of my app but the same code isn't working here for some reason.

 

The highlighted section is the part that wont work. I have a drop-down field called ApprovalNeededInput which pulls the options from the list just fine. Neither option will write to the list.

 

Patch('Retired Documents', Defaults('Retired Documents'),{Title: Text(RetiredTitleInput)}, {Reason: Text(RetiredReasonInput)}, {'Approval Required': ApprovalNeededInput.Selected}; {'Requested By':{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & RetiredRequesterInput.Selected.Mail,
Department: "",
DisplayName: RetiredRequesterInput.Selected.DisplayName,
Email: RetiredRequesterInput.Selected.Mail,
JobTitle: "",
Picture: ""
}}; {Approvers: ApproversCollection}, Form1.Updates)

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Since this is tied to a form, this should all be in the form and a SubmitForm(Form1) should be all you need.

    If there any particular reason to not do this?  A problem you ran into by doing it perhaps?

     

    What is the Items property of the ApprovalNeededInput control?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Its not tied to a form. I have an attachment field that shows up as a form element and adds attachments to the SPList item.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    If the attachments are intended for the datasource and record you are Patching, then it should all be part of the form and the SubmitForm function should be used.

     

    But again - What is the Items property of the ApprovalNeededInput control?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    ApprovalNeededInput gets 2 choice options from the Approval Required column options in the SharePoint list.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    What is the formula on the Items property of the ApprovalNeededInput control?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Choices('Retired Documents'.'Approval Needed')

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Okay...needed to make sure you were using that function - you had stated it got two choice options...made me think there was some filtering going on there.

     

    Please consider changing your Formula to the following:

    Patch('Retired Documents', 
     Defaults('Retired Documents'),
     {Title: RetiredTitleInput.Text, 
     Reason: RetiredReasonInput.Text, 
     'Approval Required': ApprovalNeededInput.Selected,
     'Requested By':
     {
     Claims: "i:0#.f|membership|" & Lower(RetiredRequesterInput.Selected.Mail),
     Department: "",
     DisplayName: RetiredRequesterInput.Selected.DisplayName,
     Email: RetiredRequesterInput.Selected.Mail,
     JobTitle: "",
     Picture: ""
     }, 
     Approvers: ApproversCollection
     }, 
     Form1.Updates
    )

    You have a variety of mismatched semicolons and commas in your posted formula, so I am not sure exactly what you have for the ApproversCollection.

    You were also trying to convert a control to text   i.e.  Text(RetiredTitleInput) 

    You need to reference the control property that contains the value you want  i.e. RetiredTitleInput.Text

     

    And again, this should really be incorporated into Form1 and be done with a SubmitForm(Form1)

    But, the above should get the basics working.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard