---
title: Configure Dynamic Home Pages
slug: configure-dynamic-home-pages
docTags: 
createdAt: 2026-08-06T03:50:03.939Z
---

## Overview

Dynamic home pages are an advanced customisation that allows Activate to present different home pages to users based on runtime conditions.

Unlike the standard configuration, which displays a single home page for all users, this approach uses a script to determine which home page should be shown when the user signs in. The script can evaluate information such as the user's roles, attributes, department, or other business-specific criteria before returning the appropriate home page.

This feature is intended for advanced implementations where different user groups require tailored landing pages or experiences. It requires familiarity with Activate scripting and the Activate resource hierarchy.

The examples in this document demonstrate role-based home page selection, but the same approach can be extended to implement virtually any business logic that can be evaluated within an Activate script.

## How it works

Normally, the HomePage1 parameter references a single web form, meaning every user is presented with the same home page.

Dynamic home pages replace this direct reference with a script. Each time a user signs in, the script evaluates one or more conditions and returns the appropriate home page as an XmlValue.

The overall process is:

1. Create a separate home page resource for each audience.
2. Replace the HomePage1 parameter with a script.
3. Add the logic that determines which home page should be displayed.
4. Return a default home page if none of the configured conditions are met.

Because the script returns an XmlValue, Activate treats the returned resource exactly as though it had been configured directly in the HomePage1 parameter.

## Create the home page resources

Create a structure beneath:

:::BlockQuote
//Resources/Configuration/Web/Home Pages
:::

For example:

:::BlockQuote
//Resources/Configuration/Web/Home Pages
├── Administrators
│   └── HomePage
├── Service Desk
│   └── HomePage
├── Managers
│   └── HomePage
└── Default
&#x20;   └── HomePage
:::

Each HomePage resource should contain the web form that will be presented to that audience.

You can organise these resources however you prefer. The important requirement is that the resource paths referenced in the script match the actual resource locations.

## Configure the HomePage1 parameter

Navigate to:

:::BlockQuote
//Resources/Configuration/Web
:::

Change the HomePage1 parameter from a web form to a script, then replace its contents with:

:::BlockQuote
using System;
using Innovation.Activate;

class Script : ScriptBase
\{
&#x20;   public XmlValue main()
&#x20;   \{
&#x20;       if (CurrentUser.Roles.Contains("Administrators"))
&#x20;           return Evaluator.GetObject("=//Resources/Configuration/Web/Home Pages/Administrators/HomePage") as XmlValue;

&#x20;       // TODO: Put your other logic for dynamic home pages here

&#x20;       // Fallback to the default home page if no other conditions match
&#x20;       return Evaluator.GetObject("=//Resources/Configuration/Web/Home Pages/Default/HomePage") as XmlValue;
&#x20;   }
}
:::

The script now becomes responsible for determining which home page should be displayed whenever a user signs in.

## Understanding the script

The script executes every time the home page is requested.

It evaluates each condition in order until one returns true. When a matching condition is found, the corresponding home page resource is returned.

In the example above, the first condition checks whether the current user belongs to the **Administrators** role:

:::BlockQuote
if (CurrentUser.Roles.Contains("Administrators"))
:::

If the condition evaluates to true, the administrator home page is returned:

:::BlockQuote
return Evaluator.GetObject(
&#x20;   "=//Resources/Configuration/Web/Home Pages/Administrators/HomePage"
) as XmlValue;
:::

If the condition evaluates to false, execution continues to the next condition.

If no conditions match, the script returns the default home page.

## Adding additional conditions

Additional home pages can be introduced by inserting more conditions before the default return statement.

For example:

:::BlockQuote
using System;
using Innovation.Activate;

class Script : ScriptBase
\{
&#x20;   public XmlValue main()
&#x20;   \{
&#x20;       if (CurrentUser.Roles.Contains("Administrators"))
&#x20;           return Evaluator.GetObject("=//Resources/Configuration/Web/Home Pages/Administrators/HomePage") as XmlValue;

&#x20;       if (CurrentUser.Roles.Contains("Service Desk"))
&#x20;           return Evaluator.GetObject("=//Resources/Configuration/Web/Home Pages/Service Desk/HomePage") as XmlValue;

&#x20;       if (CurrentUser.Roles.Contains("Managers"))
&#x20;           return Evaluator.GetObject("=//Resources/Configuration/Web/Home Pages/Managers/HomePage") as XmlValue;

&#x20;       return Evaluator.GetObject("=//Resources/Configuration/Web/Home Pages/Default/HomePage") as XmlValue;
&#x20;   }
}
:::

Conditions are evaluated from top to bottom. The first matching condition determines which home page is displayed.

For this reason, place the most specific conditions before broader ones.

## Default home page

Always include a fallback home page at the end of the script:

:::BlockQuote
return Evaluator.GetObject(
&#x20;   "=//Resources/Configuration/Web/Home Pages/Default/HomePage"
) as XmlValue;
:::

This ensures every user receives a valid home page, even if they do not satisfy any of the configured conditions.

Without a fallback, the script may return null, preventing a home page from being displayed.

## Using other conditions

Role membership is only one possible condition.

Because the logic is implemented as an Activate script, you can evaluate any information available through the scripting API.

Examples include:

- User roles
- User attributes
- Department
- Business unit
- Location
- Group membership
- Licence or feature assignments
- Custom resource values
- Any other business-specific logic

Regardless of the conditions used, each successful branch must return an XmlValue that references a valid home page resource.

## Best practices

- Store each home page in its own resource beneath a common **Home Pages** folder.
- Use descriptive resource names that clearly identify the intended audience.
- Keep condition logic simple and easy to follow.
- Place more specific conditions before broader ones.
- Always include a default home page.
- Comment complex business logic so future administrators understand the decision process.

## Testing

Test each configured scenario to ensure the correct home page is displayed.

Verify that:

- Users receive the correct home page for their role or condition.
- Users matching multiple conditions receive the first matching home page.
- Users who do not satisfy any conditions receive the default home page.
- Every resource path resolves correctly.
- All configured home pages load successfully.

## Troubleshooting

### The default home page is always displayed

Check that:

- The user belongs to the expected role.
- The role name matches exactly.
- The condition appears before the default return statement.
- The condition evaluates to true.

### The home page fails to load

Check that:

- The resource path is correct.
- The referenced resource exists.
- The resource contains a valid web form.
- The script returns an XmlValue.
- Every possible execution path returns a value.

### The wrong home page is displayed

The script stops processing once it finds the first matching condition.

Review the order of your conditions and move the most specific conditions to the beginning of the script.

## Example resource structure

:::BlockQuote
//Resources
└── Configuration
&#x20;   └── Web
&#x20;       ├── HomePage1 (Script)
&#x20;       └── Home Pages
&#x20;           ├── Administrators
&#x20;           │   └── HomePage
&#x20;           ├── Service Desk
&#x20;           │   └── HomePage
&#x20;           ├── Managers
&#x20;           │   └── HomePage
&#x20;           └── Default
&#x20;               └── HomePage
:::

With this configuration in place, the HomePage1 script becomes the entry point for determining which home page should be presented to each user, allowing a single Activate environment to deliver tailored experiences based on your organisation's business rules.
