Skip to main content

Remove

Removes a role with the specified name.

Syntax

expression.Remove(name, delegateRole);

expression - A variable that represents a ApiFormRoles class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nameRequiredstringThe name of role to be removed.
delegateRoleOptionalstringThe name of the role to which all forms bound to this role will be delegated.

Returns

boolean

Example

Remove role in a form document.

// How to remove for a form roles?

// Remove and display the result in a form document.

let doc = Api.GetDocument();
let roles = doc.GetFormRoles();
roles.Add("Customer");
roles.Add("Seller");
roles.Remove("Anyone");
let paragraph = doc.GetElement(0);
roles.GetAllRoles().forEach(role => {
paragraph.AddText(role);
paragraph.AddLineBreak();
});