/
ASSOCIATE_INSERT ()

ASSOCIATE_INSERT ()

ASSOCIATE_INSERT (<CONTACT_CHANNEL>, [CONTACT_CHANNEL_TYPE], [NAME], [SURNAME], [PERMISSIONS], [RELATIONSHIP], [RELATIVE_CODE])

 

Adds a new ASSOCIATE for a CASE

The ASSOCIATE will be notified via email or SMS informing that the CASE sent a request to be cared by him.

The CONTACT_CHANNEL parameter must define uniquely who is the ASSOCIATE that we want to add to the CASE. We can find the following situations:

  • The CONTACT_CHANNEL provided corresponds to an account that already exists in the platform. In this case, the NAME and SURNAME parameters will be ignored. A notification (email or SMS) will be sent to the ASSOCIATE informing about the request to care for the CASE.

  • The CONTACT_CHANNEL provided does not correspond to any account of the platform. A with an invitation to join the platform and start caring for the CASE.

Input Parameters

Parameter

Type

Default

Required

Description

Parameter

Type

Default

Required

Description

CONTACT_CHANNEL

String

 

Yes

Contact channel that should be used to reach the ASSOCIATE.

Currently it is only allowed to provide an email address or a phone number.

Phone numbers must have the country prefix (e.g. “+34678876333”)

CONTACT_CHANNEL_TYPE

String

NULL

No

Possible values: “EMAIL” / “PHONE”

If this parameter is not provided, then the platform will try to detect the type of channel examining the content of CONTACT_CHANNEL

NAME

String

NULL

No

Name of the ASSOCIATE

SURNAME

String

NULL

No

Surname of the ASSOCIATE

PERMISSIONS

Array

NULL

No

List of permissions that should be granted to the ASSOCIATE. Each element of the ARRAY must be a JSON object contains the following properties:

  • code: One of the PERMISSION CODES

  • access_type:

    • “none”: Permission not granted

    • “browse”: Read-only permission

    • “edit”: Read/Write permission

Example:

 

[ { "code" : "TASKS", "access_type" : "edit"}, { "code" : "MESSAGES", "access_type" : "browse"} ]

RELATIONSHIP

String

NULL

No

Defines the relationship between the CASE and the ASSOCIATE. This value must be a valid RELATIONSHIP CODES

RELATIVE_CODE

String

NULL

No

This parameter only should be used when RELATIONSHIP = “FAMILY”, and it is used to define which kind of relative is the ASSOCIATE respect to the CASE.

The value must be one of the #RELATIVE_FAMILY CODES CODES

Return value

The function returns 1 if the execution is successful. Otherwise returns an error string

Execution

On closing the formThe ITEM containing this FORMULA must be defined as type 'ACTION' (which are always executed when a FORM is closed)

Examples

Formula

Description

Formula

Description

ASSOCIATE_INSERT(“johndoe@linkcareapp.com”, “EMAIL“, “John”, “Doe”)

Adds a new ASSOCIATE to the active CASE with name “John Doe” and email “johndoe@linkcareapp.com”

ASSOCIATE_INSERT("johndoe@linkcareapp.com",,"Perico","Uno", [{"code":"TASKS", "access_type":"edit"},{"code":"MESSAGES", "access_type":"browse"}], "FAMILY", "PARENT")

Adds a new ASSOCIATE to the active CASE with name “John Doe” and email “johndoe@linkcareapp.com” (note that the channel type has not been informed but the platform understands the format of the contact channel provided)

The ASSOCIATE will have read/write permission on the TASKs of the CASE, and only read permission on the MESSAGES.

It has also been specified the relationship stating that the ASSOCIATE is the parent of the CASE

Related content