cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
venusura
Level: Powered On

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
Level 10

Re: Show the data by the current user

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
Level 10

Re: Show the data by the current user

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.

venusura
Level: Powered On

Re: Show the data by the current user

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
Level 10

Re: Show the data by the current user

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,134)