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

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
Highlighted
Microsoft
Microsoft

Re: Remove duplicates

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
Highlighted
Community Champion
Community Champion

Re: Remove duplicates

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.

 

Highlighted
Microsoft
Microsoft

Re: Remove duplicates

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,102)