web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / User based in powerapps
Power Apps
Answered

User based in powerapps

(1) ShareShare
ReportReport
Posted on by 77

Hi , I have a helpdesk canvas app now I am trying to filter the app so that each technician can only see calls assigned to him, here is my code:

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)

 

instead I am getting an error: Invalid use of " . " I have a column in sharepoint Ticket list name AssignedTo that I am trying to reference. Any idea

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,896 Most Valuable Professional on at

    Hi @Petrusottie1 ,

    Firstly I cannot see your data and the repeating logic is a bit hard to follow here, but you might try starting with this structure. Also why are you converting dates to text - the comparisons would be much easier if they were dates.

    With(
     {
     _1Day:
     Text(DateAdd(Today(), -1)),
     _2Day:
     Text(DateAdd(Today(), -2))
     },
     Sort(
     Filter(
     Tickets,
     type = "All" ||
     (
     AssignedTo.Email = User().Email &&
     (
     Status = "New" || 
     Status = "In progress" || 
     Status = "On hold"
     ) &&
     (
     FilterGallery.Selected.TextBox1.Text = "Calls older than 2 days" &&
     Text(DateCreated) <> datetype && 
     Text(DateCreated) <> Text(Today()) &&
     Text(DateCreated) <> _1Day &&
     Text(DateCreated) <> _2Day &&
     Text(DateClosed) <> datetype && 
     Text(DateClosed) <> Text(Today()) 
     ) &&
     (
     FilterGallery.Selected.TextBox1.Text = "Calls opened today" &&
     datetype in DateCreated 
     ) &&
     (
     FilterGallery.Selected.TextBox1.Text = "Calls closed today" && 
     Tickets, datetype in DateClosed 
     )
     . . . . . 
     )
     ),
     DateCreated, 
     SortOrder.Descending
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    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 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard