Formcrafts - a form and survey platform for Salesforce, HubSpot, etc
  1. Templates
    1. All templates illustration
      All templates
    2. Application forms illustration
      Application forms
    3. Calculation forms illustration
      Calculation forms
    4. Lead generation forms illustration
      Lead generation forms
    5. Customer service illustration
      Customer service
    6. Evaluation forms illustration
      Evaluation forms
    7. Survey and feedback illustration
      Survey and feedback
    8. Operations forms illustration
      Operations forms
    9. Payment forms illustration
      Payment forms
    10. Booking and registration illustration
      Booking and registration
    11. Salesforce forms illustration
      Salesforce forms
    12. Other forms illustration
      Other forms
  2. Features
    1. 18 Form Fields illustration
      18 Form Fields
    2. 19 Integrations illustration
      19 Integrations
    3. Conditional Logic illustration
      Conditional Logic
    4. Multi-step Forms illustration
      Multi-step Forms
    5. Calculations illustration
      Calculations
    6. Partial Submissions illustration
      Partial Submissions
    7. Save & Resume illustration
      Save & Resume
    8. Payments illustration
      Payments
    9. Hidden Fields illustration
      Hidden Fields
    10. Engagement analysis illustration
      Engagement analysis
    11. Dynamic Dropdowns illustration
      Dynamic Dropdowns
    12. Dynamic Checkboxes illustration
      Dynamic Checkboxes
    13. Dynamic Tables illustration
      Dynamic Tables
    14. Multilingual forms illustration
      Multilingual forms
  3. Pricing
  4. Help
  5. Login
  6. Signup
    →
  • Help index
  • Features
    • Conditional logic
    • Prefill forms
    • Multi-step forms
    • Calculations
    • Partial submissions
    • Field references
    • Save and resume
    • Hidden fields
    • Dynamic lookup
    • Dynamic tables
    • Dynamic multiple choice
    • Dynamic dropdowns
    • Workflows
    • Multilingual forms
    • Privacy mode
    • Success message
    • Form redirect
    • GA/GTM
    • Accept payments
    • Linked forms
    • Disable form
  • Styling
    • Custom CSS
    • Custom fonts
    • Color scheme
    • Form background
  • Analytics
    • Test mode
    • Overview
    • Field analytics
    • Form engagement
  • Workflows
    • Send emails
    • Form redirect
    • Success message
    • Webhooks
    • Create PDF
    • ActiveCampaign
    • Asana
    • Mailchimp
    • Front app
    • Freshdesk
    • Google Sheets
    • Pipedrive
    • Linear
    • Klaviyo
  • Sharing
    • Custom form link
    • Embed on a page (inline)
    • Embed on a page (popup)
    • Embed in emails
    • Embed on WordPress
    • Embed on Shopify
    • Embed on Squarespace
  • Salesforce
    • Overview
    • Create records
    • Create multiple records
    • Update records
    • Related records
    • Dynamic picklists
    • Dynamic checkboxes
    • Dynamic tables
    • Attach files
    • Create PDFs
    • Form prefill
    • Experience Cloud Embed
    • Record Page Embed
  • HubSpot
    • Overview
    • Create contact form
    • Create lead capture form
    • Create customer survey
    • Prefill HubSpot form
    • Embed on HubSpot page
    • Uninstall
  • Zendesk
    • Create ticket form
    • Create CSAT survey
    • Embed on Help Center
    • Prefill ticket form
  • Admin
    • Users
    • Custom domain
    • Custom email domain
    • Vanity subdomain
    • Subscription
  • Developers
    • Embed Library
    • API keys
    • API v1
    • API v2
  • Others
    • Partner program
    • GDPR compliance
    • Workflow logs
    • White labeling
    • Using JSONPath
    • Form speed
    • Zapier
    • Entity Change Notice
  • Contact
  1. Help
  2. ›
    Others
  3. ›
    Using JSONPath

Using JSONPath

On this page
  1. Introduction
  2. Basic syntax
  3. Examples
    1. Accessing simple properties
    2. Accessing array elements
  4. Using multiple paths
  5. Notes

Introduction

JSONPath ↗ is a query language for JSON, similar to how XPath works for XML. In Formcrafts, JSONPath is used in different places, such as in webhooks, to extract specific values from JSON responses. You can test your JSON paths using this tool ↗.

Basic syntax

JSONPath expressions always start with $ which represents the root of the JSON document. You then use dot notation or bracket notation to navigate through the structure.

ExpressionDescription
$Root object
.Child operator
[]Array index or child operator

Examples

Given this JSON response:

{
  "status": "completed",
  "user": {
    "id": "usr_12345",
    "name": "John Doe",
    "email": "[email protected]"
  },
  "order": {
    "id": "ord_67890",
    "total": 79.98,
    "items": [
      { "name": "Product A", "price": 29.99 },
      { "name": "Product B", "price": 49.99 }
    ]
  }
}

Accessing simple properties

JSONPathResult
$.statuscompleted
$.user.idusr_12345
$.user.nameJohn Doe
$.order.total79.98

Accessing array elements

If you are trying to use JSONPath to fetch a list of options (such as in a dropdown field, or table field) you would be asked for Option List Path, and then relative paths.

Take this data for example:

{
  "products": [
    { "id": "prod_1", "name": "Product A" },
    { "id": "prod_2", "name": "Product B" },
    { "id": "prod_3", "name": "Product C" }
  ]
}

The Option List Path would be:

JSONPathResult
$.products[*]products array (option list path)

The relative paths for value and label would be:

JSONPathResult
$.idprod_1, prod_2, prod_3
$.nameProduct A, Product B, Product C

Using multiple paths

In Formcrafts webhook configuration, you can extract multiple values by separating JSONPath expressions with commas:

$.data.id, $.data.status, $.meta.timestamp

Each extracted value becomes available for use in subsequent workflow actions.

Notes

  1. JSONPath expressions are case-sensitive. $.User.Id is different from $.user.id.

  2. If a path doesn’t match anything in the response, no value is extracted (no error is thrown).

  3. JSONPath only works with JSON responses. If your webhook returns a different content type, values cannot be extracted.

Minimal, fast, and powerful. Try now.
Formcrafts - a form and survey platform for Salesforce, HubSpot, etc

Bodhweb GmbH,
Moltkestraße 105,
40479 Düsseldorf

Salesforce AppExchange partner logo HubSpot app partner logo
Templates
Application formsLead generation formsSurvey & feedback formsEvaluation formsSupport request formsBooking & registrationContact forms
Comparisons
vs AllFormAssemblyTypeformJotformWufooSurveyMonkey
Features
Conditional logicSalesforce formsHubSpot formsZendesk ticket formsEmail formsIntegrationsForm fields
Resources
Help centerBlogDeveloper APIGDPRStatusReport abuseContact us
Company
About usNonprofitCase studiesSecurityTerms and privacyImpressum