First here is your original formula below:
Filter(
Sort(
If(
type = "All",
Tickets,
If(
FilterGallery.Selected.TextBox1.Text = "Calls older than 2 days",
Filter(
Tickets,
Text(DateCreated) <> datetype &&
Text(DateCreated) <> Text(Today()),
Text(DateCreated) <> Text(DateAdd(Today(), -2)) &&
(Status = "New" || Status = "In progress" || Status = "On hold"),
Text(DateCreated) <> Text(DateAdd(Today(), -1)) ||
Text(DateClosed) <> datetype &&
Text(DateClosed) <> Text(Today()) &&
(Status = "New" || Status = "In progress" || Status = "On hold"),
Text(DateClosed) <> Text(DateAdd(Today(), -2)) &&
(Status = "New" || Status = "In progress" || Status = "On hold"),
Text(DateClosed) <> Text(DateAdd(Today(), -1)) &&
(Status = "New" || Status = "In progress" || Status = "On hold")
),
FilterGallery.Selected.TextBox1.Text = "Calls opened today",
Filter(
Tickets,
datetype in DateCreated
),
FilterGallery.Selected.TextBox1.Text = "Calls closed today",
Filter(
Tickets,
datetype in DateClosed
),
Filter(
Tickets,
type in Status
)
)
),
DateCreated,
SortOrder.Descending
),
AssignedTo.Email = User().Email
)
Next, I would suggest for your above formula you start with the following:
1. Test with only the below and see if you still get an error
Filter(
Tickets,
AssignedTo.Email = User().Email
)
If you get an error:
Double-check the AssignedTo field in your data source and check that you're using the right syntax to access the sub-properties of AssignedTo like Email
//Not tested and probably not valid formula
//just an example just to get you thinking on what to try if you got an error
Filter(
Tickets,
LookUp(Users, Id = AssignedTo.Id).Email = User().Email
)
However,
If you do not get an error:
2. Try using simpler date comparisons to test
Filter(
Tickets,
AssignedTo.Email = User().Email && DateCreated < DateAdd(Today(), -2)
)
3. Try consolidating the status checks you are doing. If you get a delegation warning for now it's fine, just test it but then change it to be more like the way you had it before to get rid of the delegation issue:
Filter(
Tickets,
AssignedTo.Email = User().Email &&
Status in ["New", "In Progress", "On Hold"]
)
4. Try not using Switch or even nested If functions the way you're doing, try this instead:
Filter(
Tickets,
AssignedTo.Email = User().Email &&
DateCreated >= DateAdd(Today(), 0) && DateCreated < DateAdd(Today(), 1)
)
and progressively build from there.
See if the above helps @Petrusottie1