Home
/
Desk
/
Android
/
Custom fields

Customer fields

Customer fields enables you to save additional information of a customer, and there are two ways to save information. Information can be added by your agents on the Sendbird Dashboard or by your customers from a client app.

Note: Refer to Prerequisite before saving additional customer information.


Store additional information of a customer

Use setCustomerCustomFields() method to let your customers add information about themselves directly from their app. The information must consist of a field and its value, and only the field already registered in Settings > Customer fields on the Sendbird Dashboard can be used.

Light Color Skin
Copy
Map<String, String> customFields = new HashMap<>();
customFields.put("gender", "female");
customFields.put("age", String.valueOf(30));

SendBirdDesk.setCustomerCustomFields(customFields, new SendBirdDesk.SetCustomerCustomFieldsHandler() {
    @Override
    public void onResult(SendBirdException e) {
        if (e != null) {
            // Handle error.
        }

        // Additional information of the customer is stored.
        // Some fields can be ignored if they aren't registered on the dashboard.
        // Values aren't saved if they don't match the data type of their fields.
    }
});