Client API
Fields

Fields Method

What is the Fields Method?

The Fields Method facilitates prefilling survey fields with specific values, a practical approach for populating surveys with data from your website such as user insurveyation, product details, or any other data you want to pass to the survey via hidden fields.

How to use the Fields Method

To pass data to a survey using the Fields Method, you need to note the slug of the field you want to prefill and the value you want to pass.

<script>
  window.lb("field", [
    {
      slug: "poll-1",
      value: "From a friend",
    },
  ]);
</script>