cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ganesan_gowri
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
v-qiaqi-msft
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

Best Regards,
Qi

View solution in original post

2 REPLIES 2
eka24
Super User
Super User

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.

 

v-qiaqi-msft
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

Best Regards,
Qi

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,170)