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 function on Choi...
Power Apps
Answered

Patch function on Choice button to submit to SP list

(0) ShareShare
ReportReport
Posted on by 57

Hi,

 

I have a list with few text fields and one dropdown choice field with three choices. I am trying to submit the data using patch and able to submit values for other text fields but not the dropdown field.

List - Social, Dropdown choice field in list -SM,

Dropdown field name in PowerApps -SocialMedia (Items property - Choices(Social.SM))

Here is my code on Submit button OnSelect -

Patch(Social,
Defaults(Social),
{
'Net Working Media': NWMediaValue.Text,
Mediatypes: MediaTypeValue.Text,
SM:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:SocialMedia.Selected.Value}
}
);

 

Thanks in Advance!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    Hi @Snacham ,

    I assume the target is a Choice field?

    Patch(Social,
     Defaults(Social),
     {
     'Net Working Media': NWMediaValue.Text,
     Mediatypes: MediaTypeValue.Text,
     SM:{Value:SocialMedia.Selected.Value}
     }
    )

    or is it a Lookup field?

    Patch(Social,
     Defaults(Social),
     {
     'Net Working Media': NWMediaValue.Text,
     Mediatypes: MediaTypeValue.Text,
     SM:
     {
     Value:SocialMedia.Selected.Value
     Id:SocialMedia.Selected.Id
     }
     }
    )

    This one is assuming the Items of the drop-down are simply 

    Choices(ListName.FieldName)

     Also you no longer need the "long" Azure.Connectors reference.

     

    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.

     

     

  • Snacham Profile Picture
    57 on at

    Hi @WarrenBelz ,

     

    Yes the target is a choice field and I have tried using the below but no luck -

    Patch(Social,
     Defaults(Social),
     {
     'Net Working Media': NWMediaValue.Text,
     Mediatypes: MediaTypeValue.Text,
     SM:{Value:SocialMedia.Selected.Value}
     }
    )

      I have tried passing the value to dropdown like below and it worked - 

    Patch(
    Social,
    Defaults(Social),
    {
    'Net Working Media': NWMediaValue.Text,
    Mediatypes: MediaTypeValue.Text,
    SM:{Id: 5,Value:"Test Media"}
    }
    );

     

    Not sure, what might be the mistake here. Let me know if you need anything else.

     

    Thanks,

     
     
     

     

     

     

     

     

  • WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    @Snacham ,
    Are you sure this is not a Lookup field - you do not need Id for a Choice field - it does not have one.

    Also what are the Items of your SocialMedia control and is it a Drop-down or a Combo Box?

     

    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.

  • Snacham Profile Picture
    57 on at

    Yes, it is a choice field in list -

    Snacham_1-1611782588662.png

    It is a combo box and Items property of SocialMedia dropdown - Choices([@Social].SM).

     

    Thanks,

     

  • Verified answer
    WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    @Snacham ,

    Your code

    Patch(Social,
     Defaults(Social),
     {
     'Net Working Media': NWMediaValue.Text,
     Mediatypes: MediaTypeValue.Text,
     SM:{Value:SocialMedia.Selected.Value}
     }
    )

    should work on a Choice field. Also it does not have an Id, therefore the other code should actually error. For a bit of debugging, do a collection

    ClearCollect(colSocial,Social)

    Go to View > Collections and see what is in SM.

     

    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.

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

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard