Skip to main content

Home Page Redirection

SoftyFlow provides a powerful home page redirection system that allows administrators to automatically redirect users to specific pages based on their roles, metadata, and custom conditions. This feature enables personalized user experiences and ensures users land on the most relevant page for their context.

This system integrates seamlessly with user management, role management, authentication systems, and web interface design to provide dynamic, role-based navigation.

Overview

The home page redirection system works by evaluating JavaScript conditions against user data when a user accesses the home page (/home). If a condition evaluates to true, the user is automatically redirected to the specified page instead of the default home page.

Configuration

Accessing Redirection Settings

  1. Navigate to Settings in the IDE
  2. Select Header from the settings panel
  3. View the Homepage section with redirection rules
User Management

Creating Redirection Rules

Step 1: Add a New Rule

  1. Click Create Rule button
  2. A new rule entry appears in the rules table
  3. Click the Settings icon to configure the rule
User Management

Step 2: Configure Rule Components

Project Selection

  • Choose the project containing the target page
  • Use the searchable dropdown to find projects
  • This determines which project's pages are available

Page Selection

  • Select the target page/interface from the chosen project
  • Only pages within the selected project are shown
  • The user will be redirected to this page if the condition matches

Rule Condition

  • Write a JavaScript expression that returns true or false
  • Use SF_connectedUser to access user data
  • The condition determines when this redirection applies
User Management

Step 3: Set Rule Priority

  • Use the up/down arrows in the Sort column
  • Rules are evaluated from top to bottom
  • First matching rule wins - subsequent rules are ignored
  • Place more specific rules higher in the list

Rule Examples

Basic Role-Based Redirection

Basic Role-Based Redirection

These examples use role IDs to route users to appropriate interfaces based on their permissions.

Metadata-Based Redirection

Metadata-Based Redirection

These examples use custom metadata fields configured in platform settings to create business-specific routing rules.

Email-Based Redirection

Email-Based Redirection

Key Features

  • Role-based redirection: Route users based on their assigned roles
  • Metadata filtering: Use custom user metadata for conditional routing
  • JavaScript expressions: Write complex conditions using JavaScript
  • Priority ordering: Control rule evaluation order
  • Project-specific pages: Redirect to pages within specific projects

Best Practices

Rule Organization

  1. Order by Specificity: Place more specific rules first

    // More specific - should be first
    SF_connectedUser.mail === "admin@company.com";

    // Less specific - should be later
    SF_connectedUser.roles.includes("admin_role_id");
  2. Use Descriptive Conditions: Write clear, readable conditions

    // Good
    SF_connectedUser.metadata.department === "Finance" &&
    SF_connectedUser.metadata.isManager === "yes";

    // Avoid
    SF_connectedUser.metadata.d === "F" && SF_connectedUser.metadata.m === "y";
  3. Test Conditions: Verify rules work as expected before deployment using test environments

Performance Considerations

  1. Minimize Rule Count: Use fewer, well-crafted rules rather than many simple ones
  2. Efficient Conditions: Place faster-evaluating conditions first in complex expressions
  3. Avoid Heavy Operations: Don't perform complex calculations in conditions

Security Guidelines

  1. Validate User Data: Don't assume metadata values are always present

    // Safe
    SF_connectedUser.metadata && SF_connectedUser.metadata.department === "IT";

    // Risky
    SF_connectedUser.metadata.department === "IT";
  2. Use Role IDs: Reference roles by ID rather than name for consistency

  3. Sanitize Inputs: Be cautious with user-provided metadata values

Troubleshooting

Common Issues

Rule Not Triggering

  • Check rule order - ensure it's not being overridden by earlier rules
  • Verify condition syntax is valid JavaScript
  • Confirm user has expected roles/metadata
  • Check that target page exists and is accessible

Home page redirection provides a powerful way to create personalized user experiences in SoftyFlow. By leveraging user roles, metadata, and custom conditions, administrators can ensure users are automatically directed to the most relevant content for their context and responsibilities.

Remember to test redirection rules thoroughly and maintain clear documentation of your redirection logic for future maintenance and troubleshooting.