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

Get sharepoint list ID from select value in Dropdown

Dear all,

 

Is there an easy way to get the sharepoint list ID of a selection made within a dropdown? I am thinking about something along those line:

 

Set(varID;Dropdown1.Selected.Result.ID)

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @new_to_this ,

 

As you used Distinct here you'll have to use lookup to get the ID for this selected item from the datasource. 

Something like below might work in your case. 

Lookup(YourDataSource,YourDropDownDataColumnName = YourDropDown.Selected.Result).ID

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

8 REPLIES 8
PG_WorXz10
Community Champion
Community Champion

Hi @new_to_this ,

 

If your Dropdown Items property is binded by datasource and you can use below formula. 

 

Set(varID;Dropdown1.Selected.ID)

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

new_to_this
Helper I
Helper I

@PG_WorXz10  Thank you for your reply. I assume my dropdown's item property is linked to the data source. I am using Sort, Distinct, and Filter but it is the right list. However, I am getting an error using the code you suggested. The error makes basically reference to the fact that something is not compatible.powerapps_third.PNGpowerapps_fourth.PNG

@PG_WorXz10  I checked if in my gallery is actually an ID recognized using Param("ID") in the text property of a textbox. However, this box remains empty, i.e., I assume an ID is not recognized and therefore the Set function is not working properly. This obviously gets also a problem with the ThisItem function which has the same problem as no single ID is recognized.

 

Do you have by chance any idea how I could fix this problem?

Hi @new_to_this ,

 

In the gallery I assume you added a label ? 

If so try adding Thisitem.ID in the text property instead. 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

@PG_WorXz10  Yes, I added a label. Using ThisItem.ID gives me back 1 - which makes sense as it gives me back always the first row of my sharepoint list. The question now is how I can get the ID of the final value of my cacading selection process (dropdowns) within my gallery?

Hi @new_to_this ,

 

What is the items property of your dropdown ?

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

@PG_WorXz10 

All of them basically run along those lines:

Sort(Distinct(Filter(sharepointlist;FilterForWhatever);DistinctColumn);Result)

Hi @new_to_this ,

 

As you used Distinct here you'll have to use lookup to get the ID for this selected item from the datasource. 

Something like below might work in your case. 

Lookup(YourDataSource,YourDropDownDataColumnName = YourDropDown.Selected.Result).ID

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,645)