cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venusura
Frequent Visitor

Show the data by the current user

Hi All,

 

I'm working on serviceDesk app with an excel source stored in one drive.

 

Is there anyway I can show all records which are craeted by current user please?

 

ScreenName: TicketsPage

Ex: TicketID, CreatedBy , Description

       11            user1            ticket1

       12            user2            ticket2

       13            user3            ticket3

So here, I want to show only those records based on the user login.

 

I have set the defalut of CreatedBy column to Current login i.e. User().FullName

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Community Champion
Community Champion

Hi @venusura

 

Try this: Navigate(FilterPage, ScreenTransition.Fade,{SelectedType: "Inprogress"}) 

 

Then for the Items use this; ShowColumns(Filter('Tickets', User().FullName=CreatedBy, Type = SelectedType), "CreatedBy","ID")

 

I am assuming that your type column is text, but if it is choice or lookup then you need either to say Type.Value = SelectedType or to use the ID

 

Is this what you are looking for?

 

Thanks.

View solution in original post

3 REPLIES 3
Meneghino
Community Champion
Community Champion

Hi, yes, use Filter(MyExcelSource, CreatedBy = User().FullName)

 

There is a problem though, that it will be really really slow, particularly if you source has many rows.  This is because the User() function gets called for every row!

 

The way to deal with this is to cache the current User either in a text box (TextBoxCurrentUser) or in a context variable (CurrentUserVar).  Then you can do something like this: Filter(MyExcelSource, CreatedBy = TextBoxCurrentUser.Text)

 

Please let me know if anything is not clear.

 

PS I would use the email instead of the full name, normally more robust.

Thanks for this,

 

Please could you tell me that where do I need to add this filter.

 

I have tried with ShowColumns(Filter('Tickets', User().FullName=CreatedBy), "CreatedBy","ID" and  I am able to see only my records but I am getting all types of records(New,Closed,Inprogerss).

 

I applied the filter Navigate(FilterPage, ScreenTransition.Fade,{type:type}) but its not working.

 

Any ideas on this please.

 

Thanks again.

 

 

Meneghino
Community Champion
Community Champion

Hi @venusura

 

Try this: Navigate(FilterPage, ScreenTransition.Fade,{SelectedType: "Inprogress"}) 

 

Then for the Items use this; ShowColumns(Filter('Tickets', User().FullName=CreatedBy, Type = SelectedType), "CreatedBy","ID")

 

I am assuming that your type column is text, but if it is choice or lookup then you need either to say Type.Value = SelectedType or to use the ID

 

Is this what you are looking for?

 

Thanks.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,797)