cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

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
Resolver I
Resolver I

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
Highlighted
Super User III
Super User III

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.
Highlighted
Resolver I
Resolver I

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.

Resolver I
Resolver I

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

Highlighted
Super User III
Super User III

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,652)