web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch a choice value f...
Power Apps
Answered

Patch a choice value from one dataverse table to another dataverse table.

(0) ShareShare
ReportReport
Posted on by 11

Hello there, 

 

I have a choice field (Type) in one of my dataverse table A. The choice field has two options ( Business and Personal). I need to patch the value of this choice field(Type) to another dataverse table B. But I kept on getting an error. Here is my code: 

 

Patch (TableB, Defaults(TableB), {Type: LookUp('TableA', Name = selectededName, Type)}), 

I also tried Patch (TableB, Defaults(TableB), {Type: LookUp('TableA', Name = selectededName).Type)})

 

Here is the error message

The type of this argument "Type" doesn't match the expected type "OptionSetValue". 

 

Can someone please tell me how to properly patch in this scenario? Thank you. 

 

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    on at

    Hi @Webpro ,

     

    Please try this:

    Patch('TestL 17S',Defaults('TestL 17S'),{Name:"ABC",Test_Choice:LookUp(Choices('TestL 17S'.Test_Choice),Text(Value)=Text(LookUp(TestL16,Name="A1").Test_Choice_2)).Value})

     

    /* TestL16 has a global choice field named 'Test_Choice_2'. 

        TestL17 has a global choice field named 'Test_Choice'. 

     

    Best Regards,

    Wearsky

  • Verified answer
    Webpro Profile Picture
    11 on at

    Hi Wearsky, 

     

    I figured out why mine doesn't work. It was because I had two local choice columns. Based on your help, I changed the column to global choices. It then worked. Thank you. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard