Why is this code not rendering any results when there are records that I have created.
Filter( 'NEST Intake System', 'Created By'.Email=varUser)
Why is this code not rendering any results when there are records that I have created.
Filter( 'NEST Intake System', 'Created By'.Email=varUser)
@mmollet I have been so impressed about the responsiveness of everyone here! It really makes developing these apps all the more enjoyable when you have a community of equally passionate people willing to share their knowledge.
As an update: I've been asked now to filter that gallery on a people/group field that allows for more than one person. I'm leaving the exploration of that to tomorrow. I don't know how I'm going to get that to happen! LOL
Thanks again for all of your help!
Glad to hear it! This forum/community is actually incredibly nice and badass in many ways! Im on here all the time just to help b/c its enjoyable. 😛 Good luck with the app!
@mmollet After posting my update I decided to try to use the Requestor field rather than the created by field that seemed to do the trick. I even extended it to include the work type colulmn which was the ultimate goal:
Filter('NEST Intake System', Requestor.DisplayName=User().FullName && 'Work Type'="NCA")
Thank you so much. Our dialogue was very helpful!
Have you tried just make a new screen and dropping in a gallery. Just delete everything out of it and add a textbox or 2 with the important data so you know what it is showing is correct such as wherever you are storing the user name. Then set the items property to the code I sent previously and see if it works on a more simple gallery. If it does then you can be sure that it isnt that code. I have a gallery here that is working with the filter I provided but the set up and other parts are obviously not the same as what you have. When I get stuck like this I generally try to start from the most basic element and then add functionality until I figure out what the issue is.
To check what is stored in 'Created By' you could always go into the list settings for that list and then show that column and see what value it has. When I did this it just had Full Name of the user stored in it.
Also NP! I am going to do my best to get this resolved today just hang in there 🙂
@mmollet You are correct! That's exactly what I'm trying to do.
It doesn't seem to like the "=". I get the red squiggly.
I tried doing 'Created by'.FullName=User().Fullname) just for kicks. "Fullname for Created By doesn't even appear as an option like "email" does.
When the code appears to be error free, it just comes back with "We didn't find any data."
I've also tried the code on my "Requestor" column which autopopulates with the current user's name as a result of the following code added to the DefaultSelectedItems of the DataCardValue:
If(NCAForm_1.Mode = FormMode.New, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:Concatenate("i:0#.f|membership|",User().Email), DisplayName:User().FullName, Email:User().Email}, ThisItem.Requestor)
Maybe something in that code can help identify a possible solution?
By the way thank you so much for your time and really wanting to help me figure this out. 🙂
We will figure it out for sure!
First I want to confirm that I understand what you are needing.
You have a gallery that is linked to a SP list?
You want to only show items in that gallery that the current user created?
Also I believe that CreateBy returns the FullName not the Email now that I am looking at it so first you should try:
Filter('NEST Intake System','Created By'=User().FullName)
Im hoping that just fixes it. Sorry for bad info yesterday!
Thanks @mmollet. I tried your code: Filter('NEST Intake System','Created By'.Email=User().Email)
and it's still rendering no results. When I inspect user() it shows me and my email address. Nothing comes up when I select Created By.
When I add the Created By field to my form and remove the filter so all records show, my name appears in the field.
I am really at a loss and I have to get this done today. 😞
Try:
Filter('NEST Intake System', 'Created By'.Email=User().Email)
Make sure to not have a ';' after this statement as for some reason when I tested this it threw an error. Very weird that it does so imo. Also Created By and User().Email shouldn't need the to lower function as they are both set by the system and in both cases are grabbed from the same variable from the user. The only way I can see this being an issue is if you recently changed the email from the admin center or something and now they arent the same.
Also check your text inputs in your gallery and see what the error is on each of those. The gallery isnt throwing an error but the controls inside of it are. Makes me think seeing that might be of some help in getting this solved.
Another thing you can do is to highlight just the 'Created By' and see what that variable is holding then highlight the User().Email and see that they match. If so then you can be sure that this string comparison isn't the issue.
@BCBuizer I've revised my response to your response.
My bad on that...I did added it and there's the delegation issue but it's still not rendering any results. I've tried both ways and they continue to render no results. I'm just throwing everything at it that I can think of.
Here's what happens without the change:
WarrenBelz
146,702
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,015
Most Valuable Professional