cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chris-Dale
Level: Powered On

Navigation based on User

I've tried a few options by reading through a lot of these forum post but can't find anything that works. It could be as simple as me not knowing what the formula entry needs to be to identify the form creator.

This is what I currently have (not working):
If(User().FullName='Created By_DataCard1',EditForm(EditCarForm);Navigate(EditDetailsScreen,ScreenTransition.None),DisplayForm(DisplayCarForm);Navigate(DisplayDetailsScreen,ScreenTransition.None))

Any advice will be greatly received

3 REPLIES 3
Community Support Team
Community Support Team

Re: Navigation based on User

Hi @Chris-Dale ,

Could you please share more details about the data source you used within your app? Is it a SP list?

Could you please share a bit more about the 'Created By_DataCard1' that you mentioned? Is the Data card within your Edit form?

Further, do you want to edit the selected item from your Gallery if the current user is the creator of the record (from) when you press the "Navigate" button from your Gallery screen?

 

I assume that the data source you used within your app is a SP List, and you want to edit the selected item from your Gallery if the current user is the creator of the record (from) when you press the "Navigate" button from your Gallery screen.

Based on the formula that you provided, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the "Navigate" icon button within your BrowserGallery screen to following:

 

If(
    User().FullName = Gallery1.Selected.'Created By'.DisplayName,
    EditForm(EditCarForm);Navigate(EditDetailsScreen, ScreenTransition.None),
DisplayForm(DisplayCarForm);Navigate(DisplayDetailsScreen, ScreenTransition.None) )

Note: I assume that you use a Gallery control to list all records of your SP list within your app.

 

 

If the data source you used within your app is not a SP list, please consider take a try with the following formula:

 

If(
    User().FullName = Gallery1.Selected.'Created By',
    EditForm(EditCarForm);Navigate(EditDetailsScreen, ScreenTransition.None),
    DisplayForm(DisplayCarForm);Navigate(DisplayDetailsScreen,  ScreenTransition.None)
)

 

 

In addition, if you do not use a Gallery to list all records of your data source, please consider take a try with the following formula:

If(
    User().FullName = ItemRecord.'Created By',   /* <-- ItemRecord represents the record you want to edit or display */
    EditForm(EditCarForm);Navigate(EditDetailsScreen, ScreenTransition.None),
    DisplayForm(DisplayCarForm);Navigate(DisplayDetailsScreen,  ScreenTransition.None)
)

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TopShelf-MSFT
Level 10

Re: Navigation based on User

Thanks for posting in the community @Chris-Dale - can you review the above reply and update the thread if it was helpful?

 

Thank you,

 

@TopShelf-MSFT 

Chris-Dale
Level: Powered On

Re: Navigation based on User

Hi sorry for the delay. I have tried the suggestions offered but unfortunately it wasn’t successful. It feels like I may be over complicating things. Basically what I want to do is check the logged in user is the creator of the selected entry. If so, they can edit if not it returns them back to the home screen.
To clarify, yes my data source is SP and I’m using a gallery.

Thanks

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,167)