In the Management Portal at Entitlement Catalog, when you configure a workflow action for a service, you can optionally replace the values in various fields with functions. With the function @[SUBSTRING(<value>,<start>, (<length>))], you can retrieve various information and combine it to create new values. The <length> argument is optional.
For example, @[SUBSTRING(Robert,2,3)] returns "obe" (= the 2nd character and subsequent characters up to a maximum of 3 characters).
Consider the following scenario:
- You want to configure a service that is aimed at creating a new user account.
- For this purpose, you first have to configure a Run Book in your Ivanti Automation environment that creates a new user account.
- In this Run Book, you specify parameters to make the Run Book generic: when executed, the first name and last name of the user need to be provided.
- The user logon name is generated from the first name and last name.
To achieve this, do the following:
- At Entitlement Catalog, create a service Create Active Directory user with service attributes FirstName and LastName.
- Add a Provide Information action with the two attributes.
- Add an Invoke Run Book workflow action and select the Run Book that you created earlier.
- On the Run Book Parameters tab, specify the service attributes FirstName and LastNamein the fields FirstName and LastName respectively.
- Insert the function @[SUBSTRING(<value>,<start>,(<length>))] in the field UserLogonName.
- Change the function to @[SUBSTRING(#Service[firstname],1,3)]#Service[lastname]. (Here the SUBSTRING function takes the first three characters of the service placeholder #Service[firstname].)
Each time this service is requested, input is requested for the first name and last name of the user. The user logon name is generated out of the values provided for the service attributes for first name and last name. For Amanda Cavendish, for example, this results in the user logon name "AmaCavendish".
If you insert the @SUBSTRING function from the Create pattern window, the <length> argument is wrapped in additional parentheses (()) to indicate that it is optional:
You must remove these parentheses to use the argument.