cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
napster
Level: Powered On

Get List Items Value using dropdown

text.PNG

 

I  have a Drop down column that gets distinct Position from list of items from a SharePoint List.

 

Distinct('JobCard',Position).

 

What i want to do is i also want to extract ID of the item populated on the dropdown list. So that i can use that up update this item when.

 

How do i do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Get List Items Value using dropdown

Hi @napster,

Could you please share a bit more about your scenario?

Do you want to extract the corresponding ID of the items (Positions) populated within the Dropdown control?

I agree with @KroonOfficeSol's thought almost. If you use Distinct function within the Items property of the Dropdown control, you could only get the Position value, you could not get the corresponding ID values.

If you also want to extract corresponding ID values from the Dropdown control, I have made a test on my side, please take a try with the following workaround:5.JPG

Set the Items property of the Dropdown control (Dropdown1) to following formula:

AddColumns(
Distinct('20181119_case13',DepartmentName), /* <-- '20181119_case13' represents the SP list data source within my app*/
"ID",
LookUp('20181119_case13',DepartmentName = Result,ID)
)

On your side, you should type following:

AddColumns(
Distinct('JobCard', Position), /* <-- '20181119_case13' represents the SP list data source within my app*/
"ID",
LookUp('JobCard', Position = Result, ID)
)

If you want to reference the ID value from the Dropdown control, please take a try with the following formula:

Dropdown1.Selected.ID6.JPG

More details about the AddColumns function, please check the following article:

 

AddColumns function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
KroonOfficeSol
Level 10

Re: Get List Items Value using dropdown

@napster

 

With Distinct you return a one table list with the values you specify, so no ID to get from your ComboBox here.

 

You should try the GroupBy() Formula. You do like this:

ComboBox.Items

 

GroupBy('JobCard',"Position", "Positions")

ComboBox.DefaultSelectedItems

 

LookUp(GroupBy('JobCard',"Position", "Positions"), Position = "MyPosition")

You can get the ID back from the group, but be aware that you will get a list off ID and not one instance. So try this in a gallery or combobox to see the results:

ComboBox1.Selected.Positions.ID

Because you get a list (Collection/Table/Array, or whatever you want to call it ;-) back you can use the in operator to filter your gallery by. On gallery.Items:

Filter('JobCard', ID in ComboBox1.Selected.Positions.ID)

I didn't try this out myself, but theoretically this should work.

 

btw see you have a dropdown. I would advice to change this to a combobox and disable the multiple selection option.

 

Hope this helps.

 

Paul

 

Community Support Team
Community Support Team

Re: Get List Items Value using dropdown

Hi @napster,

Could you please share a bit more about your scenario?

Do you want to extract the corresponding ID of the items (Positions) populated within the Dropdown control?

I agree with @KroonOfficeSol's thought almost. If you use Distinct function within the Items property of the Dropdown control, you could only get the Position value, you could not get the corresponding ID values.

If you also want to extract corresponding ID values from the Dropdown control, I have made a test on my side, please take a try with the following workaround:5.JPG

Set the Items property of the Dropdown control (Dropdown1) to following formula:

AddColumns(
Distinct('20181119_case13',DepartmentName), /* <-- '20181119_case13' represents the SP list data source within my app*/
"ID",
LookUp('20181119_case13',DepartmentName = Result,ID)
)

On your side, you should type following:

AddColumns(
Distinct('JobCard', Position), /* <-- '20181119_case13' represents the SP list data source within my app*/
"ID",
LookUp('JobCard', Position = Result, ID)
)

If you want to reference the ID value from the Dropdown control, please take a try with the following formula:

Dropdown1.Selected.ID6.JPG

More details about the AddColumns function, please check the following article:

 

AddColumns function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.