How to filter a datatable

Iron Contributor

How can i Filter a datatable in Powerapp?

 

I have a screen with a datatable with 3 columns. Datatable is based on a sharepoint list that is connected to my powerapp.

Title | Description | Status

I want to filter on status

Status contain text and i want to filter on things that contain "Ye"

 

I have looked everywhere, it seems like ppl are able to filter a datatable. but i can not get it to work.

 

Filter('Underlag Kostnader';Status= "Ye")

Underlag Kostnader = my sharepoint list

Status = status column in the datatable.

Datatable is caled "Datatable1_1"

 

Above code is placed in a "onselect" button. So idea is the when i press the button, the list is filtered.

Is this possible and if so how?

 

9 Replies
Depends on if you're passing in any values from other controls, but If mind serves right you need to use .value after Status, so Filter('datasource';Status.Value = "Ye")

Give that a whirl.
That did not work either.
Filter('Underlag Kostnader';Type.value="Ye")

I get the error telling me that i cant use the "." (dot).
Tried ; and : aswell... no luck

I was thinking in terms of drop downs in powerapps. It should just let you filter on that the way you did it, did it give an error that way or it just doesn't return anything?
Possible that it's multi choice value?
Filter(SharePointListName,"SearchValue" in Choice.Value)
Still nothing.
Tried your last code aswell.
Tho im not sure what you mean by drop downs in powerapps?
This is my first app.. my idea is to use a button to activate a filter, but if there is a better way im open for it.
Oh now that you say that I see the issue, I should have caught on with the original post. You can't use filter onselect, you basically have to take your gallery items property is where you set your filter and you need to set it there.

Basically you need to have a filter value either via Textbox, or from another gallery and set the filter value to that. So if you create a textbox to put your filter in then this.

Filter(
Inventory,
Columnname,
textbox.text
)

So when you input that value into the Textbox you get the filter. You can create a manual drop down box as well, but if you need all values, then you have to use an IF statement in the items field saying IF it's blank then this, else use the filter so

If(textbox.text = "", 'datasource', Filter('datasource',columntofilter = textbox.text)

@Chris WebbI dont get it... where do i put what code?

 

i created a textbox and typed in this

Filter('Underlag Kostnader';Status;TextInput1.Text)

 

put on the textbox onchange and tried the onselect

textbox dont have a Item to put anything on so i dont know where to put the code

 

"underlag kostnader" = sharepoint list and datasource

status = column

textinput1 = textbox

 

My recommendation to you is go yo youTube and search for Shane young powerapps and whatch his videos around filter and lookup and a few others surrounding the topic.

@Chris Webb 

That worked really good. I changed tactic after watching a few videos. I got a first filter working now.

 

Now i need a bit of more help tho :)

 

This line works

Filter('Underlag Kostnader';TextInput1.Text in Beskrivning)

The code is put on GALLERY´s Items

Screenshot: http://prntscr.com/n0polx

So typing in TextInput1 i filter the column called Beskrivning.

But how can i now filter by searching in column Rubrik with TextInput1_1?

 

I tried just double the code like this:

Filter('Underlag Kostnader';TextInput1.Text in Beskrivning)&Filter('Underlag Kostnader';TextInput1_1.Text in Rubrik)

 

But it did not work.