Custom Property in Additional page script

Modified on Thu, 25 May, 2023 at 4:37 PM

Custom Properties consist of name and value and those values can be applied and checked by Custom Property Rules in the scope of Visibility rules, Autostart conditions or Segments.


Typically, the Property is defined via Newired Overlay API in the DecorateContext function which is called by the Overlay during initialization.


When it is not possible to update the target web application and Overlay is deployed via Newired Web Extension, then Preload Script can be used for defining and application of Custom Properties. The mentioned script can be inserted in Portal in Site Advanced Settings in the section Additional page script:


Example:

Property name is "role" and property value is "admin":



Any javascript code which is inserted here, is executed during Newired Overlay initialization.



Example: Segment rule defined by Custom Property


As an example, below target application defines various teams of users. Information about what users and teams are logged in, is provided by a service called /user.



Requirement is to create a Segment for users belonging to the team called "tester":


  1. Define decorateContext() function that customize Context with Custom Property teams that contains Teams of a logged user. Put the script into the Additional page script section in Site Advanced Settings in Portal:


  2. Define Segment with Custom Property Rule that checks if property teams contains string "tester":




 




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article