cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VineethKN
Helper I
Helper I

get different column value in Combobox

Hi All,

i have 2 Lists, List A List B

List A

State            StateId             StateCode      CountryId

 

 

List B

CountryId             CountryName

 

 

i have used a ComboBox and mapped it to Country where it shows the CountryName as Selectable values,

now how can i get the CountryId Value of the Item Selected in ComboBox(Combobox is restricted to use Multiple Values), something like using in below

 

Patch(ListA , ThisItem , {CountryId: dd_Country.SelectedItem.CountryId} ), But i can select only CountryName in Place of CountryId(dd_Country.SelectedItem.CountryName),

How can i get the other column value in Combobox, 

Thanks in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions

@VineethKN 

 

Can you share the snippet that you have used on the Combobox items? Also, please make sure that you are referencing to correct attribute name.

View solution in original post

7 REPLIES 7
yashag2255
Dual Super User II
Dual Super User II

@VineethKN 

 

Can you try the expression:
 
Patch(ListA , ThisItem , {CountryId: dd_Country.Selected.CountryId} )
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Thanks for the reply yashag2255, i have tried this, but it doesn't work,  it gives the below error

 

The type of this argument 'CountryId' does not match the expected type 'Number'. Found type 'Error'

The function 'Patch' has some invalid arguments.

 

@VineethKN 

 

Can you please confirm what dd_Country.Selected.CountryId is returning? You can test this out by creating a temporary label and updating its text property as: dd_Country.Selected.CountryId. If this returns the expected value, you can try to modify your expression as:
 
Patch(ListA , ThisItem , {CountryId: Value(dd_Country.Selected.CountryId)} )
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi Yashag, i tried that , its giving error

dd_Country.Selected.CountryId  "Name is not Valid"

@VineethKN 

 

Can you share the snippet that you have used on the Combobox items? Also, please make sure that you are referencing to correct attribute name.

View solution in original post

There is Snippet as such, i have just added the Combobox and for items i have selected the Country List.

 

Sorry, My bad, i actually gave Country.CountryName in Items property of Combobox, so was facing that problem.

Thanks a lot for your help 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (992)