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

Dropdown filter with Choice column in SP list, 2 collections and 3 filters on my data table

Hei, 

 

I've run into a problem. Firt of all, i have a filter for my SP list datatable that filters it by the logged on user, so one can't see irrelevant cases. 

I want to add 2 dropdown filters. One filters by a Choice column 'Process' and the other is MonthY

 

My current filter on the datatable is Filter(mydatasource, 'Created By'.DisplayName = User().DisplayName)

 

When I add 2 colections to screen3

ClearCollect(collectProcess, {Result: "All"}); \\ My choice column dropdown doesnt get "Add" added to the top of the list, but a blank space. 

Collect(Choices([@'MySPlist'].Process));

ClearCollect(collectMonthY, {Result: "-"});  \\ This works for my dropdown and the first value also shows - 

Collect(collectMonthY, Distinct(MySPlist, 'MonthY)

 

How could I solve that it does show the All for the choice column dropdown? How could I get the collection right so if works for both? 

And how could I combine all 3 filters on the datatable ? 

 

The first filter is Filter(mydatasource, 'Created By'.DisplayName = User().DisplayName), how could the If statemnt look like? 

1 ACCEPTED SOLUTION

Accepted Solutions
KalvisT
Helper II
Helper II

I found a solution 

 

My onvisible for screen 3 is 

ClearCollect(collectMonth,{Result:"-"});

Collect(collectMonth,Distinct(Kvalitet_2021,MånedY));

ClearCollect(Prossess, {Value: "All"}, Choices([@Kvalitet_2021].Prossess));

 

And filter is 

Filter(

    Kvalitet_2021,

    'Behandlet av'.DisplayName = varUser && Substitute(

        ddProssess.SelectedText.Value,

        "All",

        ""

    ) in Prossess.Value,

    (ddMonth.SelectedText.Value = "-" || MånedY = ddMonth.SelectedText.Value)

)

 

View solution in original post

7 REPLIES 7
iAm_ManCat
Super User
Super User

Hi,

 

I'm thinking that you are looking to be able to select any part of your filters and have them filter the datatable.

 

For your first problem you are collecting Result when you should be collecting Process:

ClearCollect(collectProcess, {Process: "All"}); 
Collect(collectProcess, Choices([@'MySPlist'].Process));

 

Then for your datatable you should look at using something like this - you may need to modify this to the applicable dropdown, column and datasource names:

 

Filter(
       mydatasource,
       'Created By'.DisplayName = User().DisplayName
       &&
       (
            dropdown1Name.Selected.Process = "All"
            ||
            Process = dropdown1Name.Selected.xyz
       )
       &&
       (
            dropdown2Name.Selected.Result = "-"
            ||
            MonthY = dropdown2Name.Selected.Result
       )
)

 

If you could give that a try and let me know if that works and come back with any issues you encounter.

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Hei, thanks for the help

 

But It still doesnt show All withe the dropdown filter  for process. 

And the filter formula has problemas with

Proces = dropdown1.Selected.xyz // = sign is underlined red and .xyz. 

Hi,

 

Yes xyz should be Process (or whatever the value you get from Intellisense for that dropdown, which is why I said you will need to modify it)

 

Could you try changing that and let me know?

 

Thanks,

Sancho 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


So my collection looks like this :

ClearCollect(collectProssess, {Prossess: "All"});

Collect(collectProssess,Choices([@Kvalitet_2021].Prossess));

ClearCollect(collectMonth, {Result: "-"});

Collect(collectMonth,Distinct(Kvalitet_2021, MånedY));

 

And filter looks like this, problem is still with the = sign when i compare Prossess with the dd.prossess.selected.Prossess. Incompatible types for comparison (Record, Text)

 

Filter(Kvalitet_2021, 'Behandlet av'.DisplayName = varUser &&

(

    ddProssess.Selected.Prossess = "All"

    ||

    Prossess = ddProssess.Selected.Prossess

)

&&

    (ddMonth.Selected.Result = "-"

    ||

    MånedY = ddMonth.Selected.Result

    )

)

Ok,

 

I think it might be that you need to check whether any of the options have further intellisense options by typing . next to them, or else try using SelectedText if that is an option.

 

Filter(
       Kvalitet_2021,
       'Behandlet av'.DisplayName = varUser
       &&

       (

          ddProssess.SelectedText.Value = "All"

          ||

          Prossess = ddProssess.SelectedText.Value

       )

       &&

      (
          ddMonth.Selected.Result = "-"

          ||

          MånedY = ddMonth.Selected.Result

      )

)

  

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Sadly I still can't get it to work. Not compatible values. The other 2 filters work fine. And nothing happens if I write .next. Would or could it be different if I'd hardcode the values from my choice column in SP List? 

KalvisT
Helper II
Helper II

I found a solution 

 

My onvisible for screen 3 is 

ClearCollect(collectMonth,{Result:"-"});

Collect(collectMonth,Distinct(Kvalitet_2021,MånedY));

ClearCollect(Prossess, {Value: "All"}, Choices([@Kvalitet_2021].Prossess));

 

And filter is 

Filter(

    Kvalitet_2021,

    'Behandlet av'.DisplayName = varUser && Substitute(

        ddProssess.SelectedText.Value,

        "All",

        ""

    ) in Prossess.Value,

    (ddMonth.SelectedText.Value = "-" || MånedY = ddMonth.SelectedText.Value)

)

 

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!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,632)