• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

How to get data from this array?

Status
Not open for further replies.

davidw

Member
I have a JSON object:

JSON:
[
  {
    "id": 5813007,
    "key": "_order_number",
    "value": "15370"
  },
  {
    "id": 5813049,
    "key": "_stripe_fee",
    "value": "1.14"
  },
  {
    "id": 5813050,
    "key": "_stripe_net",
    "value": "3.54"
  },
  {
    "id": 5813063,
    "key": "_wcpdf_invoice_number",
    "value": "IV-101033"
  }
]

How do I get the values to pass on to the next step in Pabbly?
 
P

Pabblymember11

Guest
Hey @davidw

To convert the JSON array in the response into key-value pairs for use in another action step, please use the "JSON Extractor by Pabbly" action step.

1698833115287.png


 

davidw

Member
Thanks, but I can't use this method because the array may not be the same length or in the same order every time. I figured out a JavaScript method. When the code is inline, it works:

pabbly code inline.png


But when I replace the JSON with the variable from the previous step I get an error:
pabbly code variable.png


Why is there a difference with the 2? The only difference is I have substituted the JSON object with the token from the previous step.
 
P

Pabblymember11

Guest
Could you please provide the URL of the workflow where you've attempted the same?
 
Status
Not open for further replies.
Top