I'd like to use the filter function and filter on a datasource. Is this somehow possible?
E.g. when User().Email = firstname.lastname@example.org use datasource "john_doe".
I hope this makes sense. The reason I'm asking is that each of our users has his own table/datasource. Whenever someone is using the PowerApps application it should only show his/her table.
Unfortunately this is not possible that I am aware of.
Why does every user have his\her own datasource? Can you not use the same data source and filter the data based on the logged in user?
Awww, that kinda sucks.
Unfortunately not. The DB schema is given (SAP) and I can't change it. Maybe my thinking is wrong and there might be another solution, but I want to display a set of data in a gallery based on the logged in user. This "set of data" is always a table and it varies based on the logged in user.
You can use it from PowerApps and Flow as well.
You could also use Flow to issue SQL queries to SQL which could be dynamic based on that is passed to it from PowerApps.
See below very cool video from Mr Dang on how this can be done.
This is an example of how we have used it in the past.
Thanks for that suggestion. Is the filter function working with a variable? I already tried to use a label field containing the right name like so Filter(label, ....), but without success.
You could try to add all these data sources to this app, and then use If function to make controls to use different data sources according to the login user. For example, you have SharePointList1 and SharePointList2 data sources connected to this app, then for a gallery control, set below formula in the Items property:
and so on..
I see your point. Thanks...
However, there might be hundreds of users (leaving the company, joining the company) which is why a hardcoded name isn't a solution.
It would need to be more something like:
If(user().Email = Lookup(...)
to check a table for the right email address assigned to that user. As each other will get his own table I can't always rewrite PowerApp to add the new tables as data sources.
Keep your eyes open for our upcoming T-shirt design contest!
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020