Custom Attributes
Set custom attributes to a user's profile
Last updated
Set custom attributes to a user's profile
Last updated
Use the createProfileCustomAttributes
mutation to add or update a set of custom attributes associated with the user's profile. These attributes can then trigger/affect different program rules.
Using the append
argument as true
the custom attributes sent in the mutation will be added to the existing ones. While using the append
argument asfalse
will overwrite your custom attributes.
Use the myProfile
query to verify that your attributes were added or updated correctly.
See these examples.
The following example will create custom attributes based on the values sent in the object.
Overwrite your custom attributes by sending different values, therefore, all the attributes created before are replaced with the new ones. See the example below:
Use the append
argument to update your existing attributes:
Based on the previous example, the new attribute will be added to the current one:
Argument
Required?
Type
Description
attributes
True
Object that includes all the custom attributes to add in the query.
append
False
Boolean
True if it is required to add new custom attributes to the existing ones. By default, this argument is sent as False., therefore the custom attributes values will be overwritten.
Field
Type
Description
name
String!
attribute name
dataType
AttrDataType!
attribute data type: STRING, INT, FLOAT, BOOLEAN
value
GenericScalar!
Attribute value which can be String, Boolean, Int, Float, List or Object.
category
String
category name
timestamp
Float
timestamp in float format
Field name
Type
Description
success
Boolean
True if the custom attribute list has updated successfully. Otherwise, it returns False
errors
Error Type
It retrives an error in case the custom attribute cannot be added. Sent the error field as follows:
errors { field messages }