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 with drop down n...
Power Apps
Answered

Patch with drop down not working

(0) ShareShare
ReportReport
Posted on by 709

PowerHi Guys,

 

I am new to Powerapps and I am trying to build an app for mobile users with their Time in and Time out with Cascading drop-down list which is been taken from SharePoint List.  

 

I am able to Build an app with all the combination and permutation. But when it come to send the data from Powerapp form to SP . Its not happing.

 

I am able to send data the one which is in Text format but failing big time with drop-down and date. 

 

 

 

Sample Code:  Patch(ATM,Defaults(ATM),{Title:TextInput1_1.Text,Comment:Comments.Text,Category:Dropdown1.Selected.Value})

 

The type of argument 'Category does not match the expected Type' Record' Found type Text

The function Patch has some invalid arguments.

 

In Sharepoint too I have defined Category as Choice field.

 

 
Powerapp.JPG
SP.JPG
Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @akbarmahfuzalam 

    Just use .Selected, ie

    Patch(ATM,Defaults(ATM),
     {Title:TextInput1_1.Text, Comment:Comments.Text, Category:Dropdown1.Selected})

    Then for date you use .SelectedDate.

     

    The error message is telling you why. A Choice field in SP is not just a single value it is a table of results so the Patch expects a full RECORD ie ALL the columns associated with the Category that is selected. This is why .Selected is used because it returns the entire record.

     

    A simple way to see this in PowerApps is to create a collection and look at what makes a Choice column. You can do this via this code on a Button:

    ClearCollect( colChoice, Choices(ATM.Category))

    Then have a look at the table produced: View --> Collections --> colChoice

     

    Hope this helps.

  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    Hey @akbarmahfuzalam 

    Welcome to the community!

     

    Based on your SharePoint Screenshot, your column "Category" is a Text field. Try this:

    Patch(List;{Title:Dropdown1.SelectedText.Value;Choice:Dropdown1.SelectedText})

    If you want to update a text field with the selected dropdown item, use "Dropdown1.SelectedText.value".
    If you want to update a choice field with the selected dropdown item, just use "Dropdown1.SelectedText"

     

    Hope this helps you!

     

    Regards

    Marvin

     

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

  • akbarmahfuzalam Profile Picture
    709 on at

    Thanks, Elman for your quick response, But it seems to be again not working. If i remove the Dropdown section it work but the moment i added the dropdown it doest work for me.

    Error.JPG
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @akbarmahfuzalam 

    Could you please supply the Items property of your Dropdown

  • akbarmahfuzalam Profile Picture
    709 on at

    Hi Marvin, Thanks for your Quick Response.

    I am not able to figure out what need to done or what changes it required on my formula. When I submit the data. Its not storing in in the SP.

     

    and I am getting an error on the button as screenshot is attached for your REF

    Error2.JPG
  • akbarmahfuzalam Profile Picture
    709 on at
    LanguageProcessInputCategorySub Category
    ArabicAbcWFH- ArrivalWork from homeWork from home
     BDshWFH- ExitWork from home 
     gkhk Idle 
     shsh Off 
       Planned Leave 
       Resigned 
       Self-Quarantine 
       Unplanned Leave 
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @akbarmahfuzalam 

    Thanks for that but I don't need the actual items but the code that is in the Items property of your Dropdown inside PowerApps. Also, are you using a Dropdown or a ComboBox?

     

    Cheers

  • akbarmahfuzalam Profile Picture
    709 on at

    I am using Drop Down and the code goes like this..

     

    Patch(ATM,Defaults(ATM),
    {Title:TextInput1_1.Text, Comment:Comments.Text, Category:Dropdown1.SelectedText, SubCategory:Dropdown2.SelectedText,Internetfeasibility:Dropdown5.SelectedText,Language:Dropdown6.SelectedText,Process:Dropdown7.SelectedText})

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @akbarmahfuzalam 

    Thanks, but that's the code on your 'Record Data' button, I get that. What I want to know is the code for the Items property of your Dropdown. To get this, inside PowerApps select your Dropdown control then in the dropdown Menu on the left hand side scroll to the Items property and get the code that's there.

  • akbarmahfuzalam Profile Picture
    709 on at
    Distinct(CascadingList,Title)

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

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard