Skip to content

feat(flows): map javascript json paths to custom fields - #1136

Open
JuanBifrost wants to merge 1 commit into
ChatbotXIO:mainfrom
JuanBifrost:feat/javascript-json-path-mapping
Open

feat(flows): map javascript json paths to custom fields#1136
JuanBifrost wants to merge 1 commit into
ChatbotXIO:mainfrom
JuanBifrost:feat/javascript-json-path-mapping

Conversation

@JuanBifrost

Copy link
Copy Markdown

Summary

Execute JavaScript can map any JSON path from the returned value onto any custom field, using the same “Pick JSON path” picker as External API Request. An optional dump field still stores the full return value.

Existing steps that only set customFieldId keep working (mapping defaults to []).

Tested in production: split a stored lat,lng GPS string into two custom fields from one JS step.

How to test

  1. Add Execute JavaScript that returns an object, for example return { latitude, longitude }.
  2. Open Pick JSON path, paste a sample JSON, and map each path to a custom field.
  3. Confirm both fields are written when the step succeeds.
  4. Confirm a scalar return still requires the dump/output field.

Screenshots

Builder: JSON path rows (latitude / longitude → custom fields). The optional “full JSON output” field can stay empty:

image

WhatsApp: after the location pin, JS writes the two fields and the flow echoes them (lat / lon). The native “Send location” button is from a separate Get User Data change, not this PR:

image

Let Execute JavaScript use the same JSON-path picker as External API Request so any returned object can fill any custom fields the author chooses.

Co-authored-by: JuanBifrost <JuanBifrost@users.noreply.github.com>
@github-actions github-actions Bot added the feature New feature or request label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants