• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

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?
 

Supreme

Well-known member
Staff member
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.
 

Supreme

Well-known member
Staff member
Could you please provide the URL of the workflow where you've attempted the same?
 
Status
Not open for further replies.
Top