Find and Create Records Automatically with the Pre-Chat APIs

Use the Pre-Chat API to search for or create customer records automatically when a customer completes a pre-chat form.

The legacy chat product is scheduled for retirement on February 14, 2026, and is in maintenance mode until then. During this phase, you can continue to use chat, but we no longer recommend that you implement new chat channels. To avoid service interruptions to your customers, migrate to Messaging for In-App and Web before that date. Messaging offers many of the chat features that you love plus asynchronous conversations that can be picked back up at any time. Learn about chat retirement in Help.

Important

  • findOrCreate.map

    Use the findOrCreate.map method to search for or create records that contain specific customer details.

  • findOrCreate.saveToTranscript

    Use the findOrCreate.saveToTranscript method to find or create a record and save it to the chat transcript associated with the chat.

  • findOrCreate.showOnCreate

    Use the findOrCreate.showOnCreate method to find or create a record and automatically open it in a subtab in the Salesforce console.

  • findOrCreate.linkToEntity

    Use the findOrCreate.linkToEntity method to link the record you found or created to another record type.

  • findOrCreate.displayToAgent

    Use the findOrCreate.displayToAgent method to specify which pre-chat details will be displayed to agents for incoming chats in the widget and in the Details tab when they receive a chat request.

  • Find and Create Records Pre-Chat API Code Sample

    Test and preview how to automatically create records when a customer completes a pre-chat form using this code sample.