cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chris-Dale
Frequent Visitor

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
v-xida-msft
Community Support
Community Support

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.
Anonymous
Not applicable

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

 

Thank you,

 

@Anonymous 

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,634)