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

Show only Letters with which the names begin

Hi,

 

i had a simple collection like 

 

ClearCollect(
colLetters;
["A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z"]
)

 

 

Now I want to show only the letters with which the name begins in the Excelsheet with colomn "Display Name"

 

As example the excelsheet look like:

 

Display NameUserIDStreet
Max Mustermann1Street 1
Anna Müller2Street 2
Karla Kolumna3Street 3
Zoe Peters4Street 4
Peter Parker5Street 5

 

Now the gallery with the item: colLetters should only show the Letters: A K M P Z

 

How does it work?

2 ACCEPTED SOLUTIONS

Accepted Solutions

I did not get the impression that it was not static. I have done a test with a combobox6 which works fine:

Create a collection OnVisible or OnSelect of a Button:

       ClearCollect(NewExcelColl,AddColumns
          (ExcelSheetTable,"NewColumn",Left('Display Name',1)))
 
In the Items of the Combobox6 put: ColLetters (Since you already have a collection)
 
Then Filter as follows:
Filter(NewExcelColl,NewColumn in ComboBox6.SelectedItems.Value)
 
Thus whatever the number of letters will be filtered
 
The collection in the App works faster and improve performance compared to the table.
 
------------

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.

 

View solution in original post

With your help I get another solution.

 

In Item of the gallery:

SortByColumns(Distinct(colBenutzerliste.NewColumn;NewColumn);"Result";Ascending)

 

What is your opinion?

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

Create a collection OnVisible or OnSelect of a Button:

    ClearCollect(SelectedlLetters,["A","K","M","P","Z"]);
       ClearCollect(NewExcelColl,AddColumns
          (ExcelSheetTable,"NewColumn",Left('Display Name',1)))
 
Then filter the the NewExcelColl based on SelectedlLetters:
         Filter(NewExcelColl,NewColumn in SelectedlLetters.Value)
 
------------

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.
 

The letters in the example ["A","K","M","P","Z"]) are not static. They are the result of the first letter of the Value in „Display Name“

I think I have to compare the excelsheet with the formula „StartsWith“ or something like this.

I have to compare the result of the StartsWith-function and the collection with the alphabet. Or?

I did not get the impression that it was not static. I have done a test with a combobox6 which works fine:

Create a collection OnVisible or OnSelect of a Button:

       ClearCollect(NewExcelColl,AddColumns
          (ExcelSheetTable,"NewColumn",Left('Display Name',1)))
 
In the Items of the Combobox6 put: ColLetters (Since you already have a collection)
 
Then Filter as follows:
Filter(NewExcelColl,NewColumn in ComboBox6.SelectedItems.Value)
 
Thus whatever the number of letters will be filtered
 
The collection in the App works faster and improve performance compared to the table.
 
------------

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.

 

With your help I get another solution.

 

In Item of the gallery:

SortByColumns(Distinct(colBenutzerliste.NewColumn;NewColumn);"Result";Ascending)

 

What is your opinion?

That is Fine.

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

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,427)