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 / OnSelect Patch Issue
Power Apps
Answered

OnSelect Patch Issue

(0) ShareShare
ReportReport
Posted on by

Need help.

 

Below is my patch code. Seems has no issue but it shows error. The sharepoint list is a choice type. Not sure which part went wrong.

 

jasperxx_0-1700499178308.png

 

 

OnSelect =
Patch(
'Planned Leave Submission',
Defaults('Planned Leave Submission'),
{
LeaveStartDate: StartDateInput.SelectedDate,
LeaveEndDate: EndDateInput.SelectedDate,
LeaveType: LeaveDropDown.Selected.Value,
DayType: DayDropDown.Selected.Value
}
);
Navigate(SuccessfulPage, ScreenTransition.Fade)

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @jasperxx , Try this:

     

    DayType: {Value:DayDropDown.Selected.Value }

     

    Check this: https://www.matthewdevaney.com/power-apps-patch-function-examples-for-every-sharepoint-column-type/patch-a-sharepoint-choices-column/

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    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.👍

    Thanks,
    ANB


  • jasperxx Profile Picture
    on at

    It is choice column. Both "LeaveType" and "DayType " are choice type but when I used your code:

    jasperxx_0-1700499818553.png

     




    OnSelect =
    Patch(
    'Planned Leave Submission',
    Defaults('Planned Leave Submission'),
    {
    LeaveStartDate: StartDateInput.SelectedDate,
    LeaveEndDate: EndDateInput.SelectedDate,
    LeaveType: {Value:LeaveDropDown.Selected.Value},
    DayType: {Value:DayDropDown.Selected.Value}
    }
    );
    Navigate(SuccessfulPage, ScreenTransition.Fade)

  • MudassarSZ365 Profile Picture
    591 on at

    Hi @jasperxx ,

    SharePoint choice fields need to be handled differently in Power Apps. When you're patching a choice field, you need to provide a record, not just a value. For a choice field like LeaveType, the syntax should be:

     

    LeaveType: {Value: LeaveDropDown.Selected.Value}

     

    Patch Code:

     

    Patch(
     'Planned Leave Submission',
     Defaults('Planned Leave Submission'),
     {
     LeaveStartDate: StartDateInput.SelectedDate,
     LeaveEndDate: EndDateInput.SelectedDate,
     LeaveType: {Value: LeaveDropDown.Selected.Value},
     DayType: {Value: DayDropDown.Selected.Value}
     }
    );
    Navigate(SuccessfulPage, ScreenTransition.Fade)

     

    If you think my solution is helpful for you, then please accept it. 😊

     

  • jasperxx Profile Picture
    on at

    Tried the same but showed a different error.

    jasperxx_0-1700500013652.png

     

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @jasperxx, Are both column are multi select? The code is pretty straight forward. Please check another blog from Matthew Devaney. He has covered all type of column for Patch. https://www.matthewdevaney.com/power-apps-patch-function-examples-for-every-sharepoint-column-type/

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    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.👍

    Thanks,
    ANB


  • jasperxx Profile Picture
    on at

    Everything followed but still showed 

    jasperxx_0-1700501420180.png

     

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @jasperxx , Can you share the screenshot of code with error message? This could be for some other column then.

     

    Thanks,

    ANB

  • jasperxx Profile Picture
    on at

    jasperxx_0-1700501947755.png

     



    OnSelect =
    Patch(
    'Planned Leave Submission',
    Defaults('Planned Leave Submission'),
    {
    LeaveStartDate: StartDateInput.SelectedDate,
    LeaveEndDate: EndDateInput.SelectedDate,
    LeaveType: {Value:LeaveDropDown.Selected.Value},
    DayType: {Value:DayDropDown.Selected.Value}
    }
    );
    Navigate(SuccessfulPage, ScreenTransition.Fade)

  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @jasperxx , Apologies but I dont see any red cross on Submit button. Can you confirm that this error is coming from the same submit button? For example, if there is any error on code, then this is how it will look:

    ANB_0-1700502209580.png

     

    Expand the formula bar where you have written the code and try to get this screenshot that I gave in above example.

     

    Thanks,

    ANB

     

  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    @jasperxx , One more thing I noticed with whatever screenshot you gave, in the formula bar you have add "OnSelect="

     

    You do not have to add that, simply the Patch code will work for you.

     

    Thanks,

    ANB

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 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard