Hello,
I am developing an application called Activity Time Log, and I am using Excel as my DataSource (for Temporary Purpose).
I am having a problem, when I was test running the app with my O365 User ID, The gallery items shown my UserName and related field which is correct as my perspective, but when I given the app access to my organization 0365 users, the gallery still shows my data items which I had created while testing and I have also created the User Field in the excel file as well.
is there any way to filter the gallery as per the logged in user in the app and show them their gallery items not the other users items, right now I am able to filter it with the date picker, I have to Filter by the Logged in User and DatePicker together.
Any Help
Solved! Go to Solution.
Hi @MH3 ,
I was showing you a much easier way and more reliable way to do both filters.
Firstly I do not use the Office365UserProfile filter, so I cannot guide you here, but if the filter works for you, then the below code should work. The same goes for comparing two dates - turning them both into text is one way, but I use a much less complex formula as shown previously. So if your filters are correct, this should work
Filter(
Table3,
YourNameField = Office365Users.UserProfile(User().Email).DisplayName &&
Text(Date,"[$-en-US]dd/mm/yyyy") = Text(DatePicker2.SelectedDate,"[$-en-US]dd/mm/yyyy")
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @MH3 ,
Assuming you are wanting to match the user's name with the name and date fields I can see in your gallery (I will use YourNameField and YourDateField - change these in the code below). Note neither of these filters are Delegable, so large data sets may be an issue.
Filter(
Table3,
YourNameField = User().FullName &&
DateDiff(
DatePicker2.SelectedDate,
YourDateField,
Days
)=0
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz ,
Let me clear you few things,
while creating Form, I am getting the User Name as a Default Value: in Default Property
Office365Users.UserProfile(User().Email).DisplayName
and Showing it to the gallery as ThisItem.User.
Now, I tried to filter the gallery by using this formula:
Filter(Table3,Office365Users.UserProfile(User().Email).DisplayName)
as this formula is used when I am getting the name of the logged in user.
I have added the Date Picker and used this formula to filter the gallery by Date in the Gallery,
Filter(Table3,Text( Date, "[$-en-US]dd/mm/yyyy" ) = Text(DatePicker2.SelectedDate,"[$-en-US]dd/mm/yyyy"))
will your formula still work? or need some alteration which will include both Date and User Filter.
Kindly Check!
Hi @MH3 ,
I was showing you a much easier way and more reliable way to do both filters.
Firstly I do not use the Office365UserProfile filter, so I cannot guide you here, but if the filter works for you, then the below code should work. The same goes for comparing two dates - turning them both into text is one way, but I use a much less complex formula as shown previously. So if your filters are correct, this should work
Filter(
Table3,
YourNameField = Office365Users.UserProfile(User().Email).DisplayName &&
Text(Date,"[$-en-US]dd/mm/yyyy") = Text(DatePicker2.SelectedDate,"[$-en-US]dd/mm/yyyy")
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
well @WarrenBelz ,
I used exactly same formula as you provided, I'm gonna check it out, then I'll let you know.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
51 | |
47 | |
32 | |
32 |
User | Count |
---|---|
263 | |
91 | |
78 | |
68 | |
67 |