- The name of a project, organization or store
- Preferred language
- Name of their profile or team
onFormSubmit, or on your server with webhooks.
Option 1: In the browser with onFormSubmit
Pass anonFormSubmit function when you initialize Candu. It runs on every Candu form submission in that page session and receives the form’s details and the submitted values (field label to value), so you can check which form it was and use the values in your own code.
Option 2: On your server with webhooks
- Create your Form in Candu
- Guide to this is here.
- Configuring Webhooks for Form Responses
- Guide to this is here.
- Submissions made in the editor preview don’t fire webhooks. Test by publishing to a segment that only contains you and submitting in your live app.
- Handling Webhook Requests:
- In your product, you need to create a webhook endpoint to receive the data from Candu.ai.
- Set up an endpoint in your backend application that will listen for incoming requests from Candu.ai. This endpoint should be able to accept `POST requests.
- Depending on the programming language and framework you’re using, you can set up a route or controller to handle the incoming webhook requests.
- Parsing and Processing the Webhook Data:
- When a webhook request is received at your endpoint, you’ll need to extract and process the relevant data from the request payload.
- Parse the JSON or form-encoded data sent by Candu.ai to extract the form field values.
- Validate and sanitize the data as per your product’s requirements.
- You can then perform any additional processing or transformation on the data if needed.
- Populating the Data in Your Product:
- Once you have extracted and processed the data, you can use it to populate your product’s internal database or perform any other desired actions.
- This could involve storing the form data in a database, triggering specific actions based on the form submissions, or displaying the captured data in your product’s user interface.