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

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

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,808)