# Custom First Page for users

**URL:** <https://forum.inductiveautomation.com/t/custom-first-page-for-users/36860>\
**Category:** Ignition\
**Created:** [July 20, 2020, 8:09am UTC](https://forum.inductiveautomation.com/t/custom-first-page-for-users/36860 "2020-07-20T08:09:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 20, 2020, 8:09am UTC](https://forum.inductiveautomation.com/t/custom-first-page-for-users/36860/1 "2020-07-20T08:09:36Z")

</div>

Would it be possible to show a different first page in a Perspective project depending on which user has logged in ?  
Maybe using a Session Event ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 20, 2020, 11:10am UTC](https://forum.inductiveautomation.com/t/custom-first-page-for-users/36860/2 "2020-07-20T11:10:04Z")

</div>

There is a feature request to make this possible, but it is not yet. See this discussion:

> [@Doubts about session events in perspective](http://forum.inductiveautomation.com/t/doubts-about-session-events-in-perspective/36835/2):
>
> I think you’re expecting something that you can’t truly do with Perspective at this time. If you’re determining which just what page (pageA or pageB) to show a person, there are ways to do that, but you have to understand that Perspective does not open to the same page every time; depending on browser bookmarks or links or history, a user could open a new session onto any page in your Perspective Project. There are Session Events in Perspective, but Session Startup is invoked before a user has…

---

<div class="post-metadata">

**Author:** ![ppatel1](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@ppatel1](https://forum.inductiveautomation.com/u/ppatel1)\
**Post date:** [July 20, 2020, 1:28pm UTC](https://forum.inductiveautomation.com/t/custom-first-page-for-users/36860/3 "2020-07-20T13:28:51Z")

</div>

A colleague and I set upon to do this and we managed to get it working. However I have found one instance in my testing which doesn’t allow for it to work which is when you log out and log back in on the same tab. Here is our current setup: We have a database user source where we store not only the username and password but a plethora of columns that pertain to each user. One of those columns is a preferred start up view column which stores an integer (1,2,3) representing a specific view. If you don’t have a user source that allows for modifications to SQL table then you can just create a ‘Settings’ table in which you store all the usernames and a column that specifies the integer. We also have a settings view in our app that allows the users to modify which startup view they want. By default the project has a Welcome view chosen to start. We kept that. We modified that views start up script as follows:

```
self.session.custom.currentView = "Home"
userIdx = int(self.session.custom.userIdx)
preference = int(system.db.runScalarQuery("SELECT mobileViewPreference FROM listusers WHERE idx = %i"%(userIdx)))

if preference == 0:
	system.perspective.print("No pref, staying here")
	pass
elif preference == 1:
	system.perspective.print("Prefers filters")
	# prefers filters
	system.perspective.navigate("/assetselection")
elif preference == 2:
	system.perspective.print("Prefers checklist")
	system.perspective.navigate("/safetyform")

```

When the view opens we get the username that is logged in. Run a query to find the integer value that was inserted for their user in the preferred start up view column. There after an if statement checks the value we returned and the value determines the view we are redirected to . Please try this and let me know how it works out. Shout out to @bkarabinchak.psi for working on this with me!

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 20, 2020, 1:33pm UTC](https://forum.inductiveautomation.com/t/custom-first-page-for-users/36860/4 "2020-07-20T13:33:02Z")

</div>

Thanks a lot for your answer,  
It is not our priority now but if we try this out I will let you know 😉
