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

Using distinct function in combination with a Dropdown

Hi all

 

If I have a SP-list with a single-line of text column, and in that list there are alot of itemst. Then by using Distinct(SP-List.SPColumn) i am able to make a "collection" of all distinct values form that column.

 

Now, I want those values to be displayed in a Dropdown control in my PowerApp, so I insert a Dropdown control and add the aboce Distinct function to the Item. So far, so god. I am able to see all of my distinct values in it.

 

But when I want to submit the seleced value to a Dropdown column in another SP-list it fails, or nothing happens, it leavs the field blank?

 

Is it possible to add distinct values from one list using a Dropdown control to another list?

1 ACCEPTED SOLUTION

Accepted Solutions
emoii
Level: Powered On

Re: Using distinct function in combination with a Dropdown

Ended creating a lot of single line of text columns, and then I was able to parse the distinct value to those. Deleted the single line of text control in the card and added my own drop-down control, which i connected to the distinct column, and then updated the single line of text column in my list with the dropdown.selected.value.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Using distinct function in combination with a Dropdown

Are you submitting the distinct value to another SP list that has the same values in it (exactly)?

 

Are you using a edit form for submitting:

    If so, set the default of that "other list item" to the value of your distinct dropdown list.

or are you doing this through a Patch/Update statement?

    If so, you need to provide the proper SharePoint odata.type information

       MyChoiceColumn: {Value: YourDropDownList.Value, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}

        

In general, what you are doing is very possible.  Just need to make sure you are connecting the dots.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
emoii
Level: Powered On

Re: Using distinct function in combination with a Dropdown

Hi thanks for you reply

 

I have user creation in one list, listA, and that user have af column called Department. I another list, listB I have all my departments as items, single line. 

 

The experience for the one creating the user should be to click a drop down, be able to see all the departments from listB, and submit the propper department to a Column called userDepartment in listA.

 

My idea was first to create the site column in listA as Drop Down and tried to connect the Distinct function to that columns control in PowerApps using the Item field. Then, on the Update field I had dropdown1.selected, and thought that this value then would be submitted to the listA sitecolumn userDepartment, but nope.

 

I do a SubmitForm(form1, screentranstition.none) to submit to listA. I seems only to be able to chose .Results from the distinct list, and I do not know what to use that for.

emoii
Level: Powered On

Re: Using distinct function in combination with a Dropdown

Ended creating a lot of single line of text columns, and then I was able to parse the distinct value to those. Deleted the single line of text control in the card and added my own drop-down control, which i connected to the distinct column, and then updated the single line of text column in my list with the dropdown.selected.value.

View solution in original post

Super User
Super User

Re: Using distinct function in combination with a Dropdown

Very good!  But in the future, if you are working with Choice columns, keep the bit of information about submitting on hand - you will need it.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,975)