cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Distinct function

Hello, I'm building an application with powerapps.

I have a problem with a dropdownlist in my SharePoint form with Powerapps

When i select a city(="Commune" in my formule), and when i valid my input and the forms. The city doesn't appear in the SharePoint List...

This is my formule :

Distinct(Choices(IRIS.Commune);Value).Result

Can you help me please ?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Distinct function

Hi @mckent1 ,

Do you mean that your city field can not be updated successfully after you make selection in the dropdown?

Could you tell me the data type of city field?

1)If the city field is Choice type.

In this situation, the Choice() function will already return a table without duplicated value.

There's no need to use Distinct function to get duplicated city value.

Try this:

set the drop down's Items:

Choices(IRIS.Commune)

set city field datacard's Update:

citydropdown.Selected

//please replace with your city drop down name

 

2)If the city field is lookup type.

In this situation, could you tell me if there's duplicated city value in your related list, which related record's Id will be used as the lookup field's Idvalue?

For example: 

related list: city1,ID1; city1,ID2

current list: choose city 1 in this drop down, then use ID1 as the city lookup ID value or ID2 as the city lookup ID value?

I assume that use the first related record's Id.

Try this:

set the drop down's Items:

 

Distinct(Choices(IRIS.Commune),Value)

 

set city field datacard's Update:

 

{Value:citydropdown.Selected.Result,Id:LookUp(relatedlist,city=citydropdown.Selected.Result,ID)}

 

//please replace with your city drop down name, relatedlist name, city field name in your related list

 

 

 

 

 

Best regards,

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

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Distinct function

Hi @mckent1 ,

What type of column is RIS.Commune in your dataset?

Highlighted
Frequent Visitor

Re: Distinct function

Hello @WarrenBelz ,

Thanks for answering.

Column type for IRIS.Commune is a searchColumn to another SharePoint list which is on the same sharepoint site.

Highlighted
Community Support
Community Support

Re: Distinct function

Hi @mckent1 ,

Do you mean that your city field can not be updated successfully after you make selection in the dropdown?

Could you tell me the data type of city field?

1)If the city field is Choice type.

In this situation, the Choice() function will already return a table without duplicated value.

There's no need to use Distinct function to get duplicated city value.

Try this:

set the drop down's Items:

Choices(IRIS.Commune)

set city field datacard's Update:

citydropdown.Selected

//please replace with your city drop down name

 

2)If the city field is lookup type.

In this situation, could you tell me if there's duplicated city value in your related list, which related record's Id will be used as the lookup field's Idvalue?

For example: 

related list: city1,ID1; city1,ID2

current list: choose city 1 in this drop down, then use ID1 as the city lookup ID value or ID2 as the city lookup ID value?

I assume that use the first related record's Id.

Try this:

set the drop down's Items:

 

Distinct(Choices(IRIS.Commune),Value)

 

set city field datacard's Update:

 

{Value:citydropdown.Selected.Result,Id:LookUp(relatedlist,city=citydropdown.Selected.Result,ID)}

 

//please replace with your city drop down name, relatedlist name, city field name in your related list

 

 

 

 

 

Best regards,

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

View solution in original post

Highlighted
Super User III
Super User III

Re: Distinct function

Hi @mckent1 You were not far away - try. 

Distinct(Choices(IRIS.Commune),Value)

 

 

***Update - I see another post from @v-yutliu-msft since I opened my reply.
It is certainly correct that you should not have duplicates if the field is the primary lookup, however if you have a secondary field selected (lets call it Location), you would use

Distinct(Choices(IRIS.Commune:Location),Value)

and get all the distinct values from that field.

 

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.

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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