1

I couldn't update a value for the new custom prechat fields.

I am using Mobile chat-ui SDK to send a a new custom fields in Contact Entity. This custom field shows in CLT dashboard but didn't get the updated value that mobile client send.

Btw, we can update it manually via CLT dashboard. I verified the key in CLT setting and it's correct. This is mobile client code

    val chatConfigurationBuilder = ChatConfiguration
        .Builder(ORG_ID, BUTTON_ID, DEPLOYMENT_ID, LIVE_AGENT_POD)

    val nameData = ChatUserData("name", firstName, true)
    val keyData = ChatUserData("key__c", "key_value", true)
    val customData = ChatUserData("custom_field__c", "custom_value", true)

    val contactEntity = ChatEntity.Builder()
        .showOnCreate(true)
        .linkToTranscriptField("contact")
        .addChatEntityField(
            ChatEntityField.Builder()
                .doFind(false)
                .isExactMatch(false)
                .doCreate(true)
                .build("name", nameData)
        )
        .addChatEntityField(
            ChatEntityField.Builder()
                .doFind(true)
                .isExactMatch(true)
                .doCreate(true)
                .build("key__c", keyData)
        )
        .addChatEntityField(
            ChatEntityField.Builder()
                .doFind(false)
                .isExactMatch(false)
                .doCreate(true)
                .build("custom_field__c", customData)
        )
        .build("contact")

    chatConfigurationBuilder.apply {
        chatUserData(nameData, keyData, customData)
        chatEntities(contactEntity)
    }

    val chatConfiguration = chatConfigurationBuilder.build()
    val uiConfig = ChatUIConfiguration.Builder()
        .chatConfiguration(chatConfiguration)
        .hideQueuePosition(false)
        .disablePreChatView(true)
        .build()

    ChatUI.configure(uiConfig)
        .createClient(activity)
        .onResult { _, chatUIClient ->
            if (!ChatCore.isActive()) {
                chatUIClient.apply {
                    startChatSession(activity)
                }
            }
        }

Any help would be appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.