And if you move User().Email to be a variable that you first set, then feed into your Set() statement in your lookup?
Set(UserEmail, User().Email); Set(CurrentUser, LookUp(Users, 'Primary Email' = UserEmail, User)); Set(UserToggle, true)
Another step in the right direction. Thank you for your persistance. This has removed all warnings, but not changed the return of the data set when unfiltered. I tried refreshing the Data Source of 'Accounts', deleting it and adding it again, and changing screens to trigger everything but no dice.
Did you mean to say it isn't changing the returned data when it IS filtered? Because nothing in setting UserEmail or CurrentUser affects the unfiltered datasource. Your formula, if I have kept up with your changes, should now be:
SortByColumn( Search( If( UserToggle, // logical test
Filter(Accounts, Owner = CurrentUser), // true case, should filter to the CurrentUser
If(SortDescending1, Descending, Ascending)
Now that I'm thinking about it, I'm wondering if you are handling your UserToggle variable properly elsewhere. You initialize it to be true, but do you change it elsewhere? Do you have a control that modifies it? If you add a label to your screen and set its Text property to be UserToggle, does it show you true when you expect true and false when you expect false?
Sorry, what I meant was that the unfiltered data set (showing all Accounts) has not changed from when there was the delegation warning. There are still a select amount of Accounts returning and some not available to be searched. All warnings of delegation have dissappeared after assigning the two variables you suggested earlier.
The toggle is working properly. It is set in the formula I previously posted and has not changed. It is only changed through the OnChange property. I added a label and it returns true when only showing my Accounts and false when showing all Accounts as expected.
One more suggestion, then...
Go back and look at @KroonOfficeSol's post where he suggested a Filter() with an OR construction.
!UserToggle.Value || Owner = CurrentUser
TextSearchBox1.Text, "address1_city","name","address1_stateorprovince" ), "name", If(SortDescending1, Descending, Ascending) )
That would remove the If() completely with a clever trick of handling the UserToggle.
If that doesn't work, I might be out of suggestions, but post back. Maybe something you encounter will spawn another thought. Good luck!
Continue your learning in our online communities.
Let's thank our top community contributors
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Features releasing from April 2019 through September 2019!
August 20-23rd 2019