Retrieve value from JSON object Flow Action#22
Merged
rohi-v merged 1 commit intoServiceNowDevProgram:mainfrom Oct 2, 2025
Merged
Retrieve value from JSON object Flow Action#22rohi-v merged 1 commit intoServiceNowDevProgram:mainfrom
rohi-v merged 1 commit intoServiceNowDevProgram:mainfrom
Conversation
…ct (either already parsed or as a string) and lets you extract a value from it using a property path. The property path can be a simple dot walk like user.name or something more complex with array indexes like user[4].name.
|
✅ Valid PR for ActionPack Thank you for your contribution. This PR complies with the CONTRIBUTING.md. |
Contributor
Author
rohi-v
approved these changes
Oct 2, 2025
Contributor
rohi-v
left a comment
There was a problem hiding this comment.
Excellent use case! Approved changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This flow action is a JSON property accessor. It takes in a JSON object (either already parsed or as a string) and lets you extract a value from it using a property path. The property path can be a simple dot walk like
user.nameor something more complex with array indexes likeuser[4].name.How it works
Inputs:
inputs.objectParsed: a user-provided JSON object (already parsed).inputs.objectStringified: a user-provided JSON string.inputs.objectProperty: the property path you want to extract (supports dot walk and index notation).Process:
It checks whether you gave it a parsed object or a stringified object.
It converts your property path (
"user[4].name") into a clean list of keys (["user", "4", "name"]).It walks through the object step by step to find the value at that path.
Outputs:
outputs.objectvaluestring: the value as a string (if the result is an object or array, it gets JSON.stringify’d).outputs.objectvaluejson: the raw JSON value (could be string, number, object, array, etc.).Example
If your JSON object looks like this:
{ "user": { "name": "Alice", "friends": [ { "name": "Bob" }, { "name": "Charlie" } ] } }With
objectProperty = "user.name"outputs.objectvaluestring = "Alice"outputs.objectvaluejson = "Alice"With
objectProperty = "user.friends[1].name"outputs.objectvaluestring = "Charlie"outputs.objectvaluejson = "Charlie"With
objectProperty = "user.friends"outputs.objectvaluestring = "[{\"name\":\"Bob\"},{\"name\":\"Charlie\"}]"outputs.objectvaluejson = [ { "name": "Bob" }, { "name": "Charlie" } ]