Custom Code on Step Level

AppNavi offers custom code capabilities on the step level as well. The option to use either the Custom Code or the updated Custom Code V2 can be toggled in the route edit, Please note that Custom Code V2 is enabled by default but for old routes custom code is enabled

Advantages of Step Custom Code
Step Custom codes are designed to help businesses or organizations tailor their Steps to their specific needs. They add customization to a particular Step, making it more efficient and effective in achieving desired goals.

For example, custom code can allow a user to do different things like playing a new route or stopping a route during the render step. During the after-render step, custom code can help a user find an element using the "getCurrentElement" tool. Additionally, with custom code v2, users can also customize the tooltip body, header, text, and hide or show buttons of the tooltip using the "onBeforeRender: event".

Differentiate between custom code and custom code v2

FeatureCustom CodeCustom Code V2
Supportmethods onlymethods and events
Execution timeBeforeRender and AfterRenderBeforeRender
FlexibilityLimitedMore flexible
NotificationNo notification systemA clearer way to receive notifications about Step events

Custom Code

When using custom code, two different events can be assigned code using separate rich code editors: BeforeRender and AfterRender.

  • BeforeRender code is executed before the step is rendered, even before the step's search begins.
  • AfterRender code is executed after the step has been fully rendered and displayed to the user.

Supported Methods

MethodsDescription
skipAutomation :methodThis method skips the automation of the current step
playStep: methodThe play step method can start any step of the current route.
stopRoute :methodThis method stops the execution of current route.
getCurrentElement :methodThis method returns the currently found HTML element
getTooltipContainer :methodThis method returns the current tooltip container dom object
getActiveRouteId :methodThis method returns the Id of the currently started route
getCurrentStepId : methodThis method returns the current step id of the currently executed route
getStartMode :methodThis method returns mode in which the route is executed (learning / automation)

for more details about Custom Code click here

Switching to Custom Code V2

To switch to Custom Code V2, simply enable the switch, which will allow custom code to be added to every step using the single rich code editor.

Supported Methods

MethodsDescription
skipAutomation :methodThis method skips the automation of the current step
playStep: methodThe play step method can start any step of the current route.
stopRoute :methodThis method stops the execution of current route.
getActiveRouteId :methodThis method returns the Id of the currently started route
getCurrentStepId : methodThis method returns the current step id of the currently executed rout

Supported Events

Event NameDescription
onBeforeSearchExecuted before the search is started.
onElementFoundExecuted after the element is found.
onElementNotFoundExecuted after the search is timed out and no element is returned by the search.
onBeforeRenderExecuted right before the tooltip is rendered and shown to the user.
onElementLostExecuted when the element's tracking is lost.

for more details about Custom Code V2 click here