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

Remove duplicates

My screen looks like

screen.png

In Dropdowns i list out the name from the Datasource"Employee"

         Items: ShowColumns(Employee, "Name", "ID")

Next To dropdown i add a Label to show the Id of the Selected dropdown 

         text: Dropdown1.Selected.Name & "" & Dropdown1.Selected.ID

both are works fine.

 

Now i have a duplicate values in the dropdowns. So i have to remove the Duplicates by giving formulas in Dropdowns. i tried but got error.

please tell me how to Code. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi@ganesan_gowri,

Could you please share a bit more about your scenario, is there only one Dropdown, is it for 'Name' or 'ID'?

Based on the issue that you mentioned, do you want to remove the duplicates from the dropdown?

Since there are duplicates in your column, I assume that you have an Excel table as your data source.

I have a test on my side, please take a try as below.

Set the Dropdown Items property as below:

 

Distinct(ProductionProcess,NAME)

 

Add a Label and set the Text property as below:

 

LookUp(ProductionProcess,NAME=Dropdown1.Selected.Result,IDen)

 

After that, you can populate the Label based on the Dropdown selected without duplicate values.

If you want to populate a Gallery every clicking the Dropdown, you can set the OnSelect property of the Dropdown as below:

 

Collect(
    Temp,
    {
        Name: Dropdown1.Selected.Result,
        IDENTY: LookUp(
            ProductionProcess,
            NAME = Dropdown1.Selected.Result,
            IDen
        )
    }
)

 

Add a blank Gallery and insert 2 Labels to it. Set the Text property as below:

 

NameLabel Text property:
ThisItem.Name
IDLabel Text property:
ThisItem.IDENTY

 

Please check the Gif as below.

0803Gif03.gif

Best Regards,

Qi

View solution in original post

2 REPLIES 2
Super User III
Super User III

To remove duplicate use disctint.

Onvisible of the screen create a collection;

ClearCollect (EmployeeCol, AddColumns (Employee, "NameAndID", Name&ID))

 

Then on the Dropdown items:

Distinct(EmployeeCol, NameAndID)

on the Items property of the dropdown.

 

Finally in your Label;

Dropdown1.Selected.Result)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Community Support
Community Support

Hi@ganesan_gowri,

Could you please share a bit more about your scenario, is there only one Dropdown, is it for 'Name' or 'ID'?

Based on the issue that you mentioned, do you want to remove the duplicates from the dropdown?

Since there are duplicates in your column, I assume that you have an Excel table as your data source.

I have a test on my side, please take a try as below.

Set the Dropdown Items property as below:

 

Distinct(ProductionProcess,NAME)

 

Add a Label and set the Text property as below:

 

LookUp(ProductionProcess,NAME=Dropdown1.Selected.Result,IDen)

 

After that, you can populate the Label based on the Dropdown selected without duplicate values.

If you want to populate a Gallery every clicking the Dropdown, you can set the OnSelect property of the Dropdown as below:

 

Collect(
    Temp,
    {
        Name: Dropdown1.Selected.Result,
        IDENTY: LookUp(
            ProductionProcess,
            NAME = Dropdown1.Selected.Result,
            IDen
        )
    }
)

 

Add a blank Gallery and insert 2 Labels to it. Set the Text property as below:

 

NameLabel Text property:
ThisItem.Name
IDLabel Text property:
ThisItem.IDENTY

 

Please check the Gif as below.

0803Gif03.gif

Best Regards,

Qi

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (5,788)