How to set the business logics on sub-string

I am currently seeking guidance on configuring PAN substring use case within vdesigner 2. The requirement is to use PAN substring functionality to facilitate two distinct journeys based on the PAN input. Specifically, the rule should evaluate the fourth character of the PAN and redirect to the appropriate journey accordingly. For instance, if the fourth character in the PAN is “C,” the system should navigate to the “Company” journey. Similarly, if the character is “I,” it should direct to the “Individual” journey.
Could you kindly provide instructions on how to configure this substring functionality to enable seamless navigation between the specified journeys based on PAN inputs? and which event is better suitable to do the same ?

The best practice involves configuring this task with an “OnCompletion” event for optimal functionality.

Here are the steps to achieve this functionality:

Drop an Input Field on the Canvas: This involves adding a text input field to the user interface where users can enter their PAN number.
Create an Entity: Define an entity of format – > { “full_pan”: “string” } to store the PAN number.

Link Entity to Data Model: Establish a connection between the full_pan entity and the data model of the application.
Events Section - OnCompletion: Set up an event handler for the “OnCompletion” event of the input field. This event triggers when the user finishes inputting their PAN number.
First Task - Copy Data: Upon completion, store the entered PAN number in the full_pan entity.

Second Task - Copy Data with SUBSTR: Use the SUBSTR function to extract a single character from the stored PAN number. The SUBSTR function takes three parameters: the entity key name (from step 2, key is full_pan), a static value (3), and another static value (4). Store this extracted character in a new entity named Substring_1.

Final Task - Navigate: Determine the destination screen based on a Business Rule Engine (BRE). The condition for navigation involves comparing the key name (presumably of Substring_1) with a static value (“I” and “C”). If the condition is met, navigate to a specific screen.