Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

javascript - Extracting Array from JSON in Zapier Webhook

This is part of my webhook response in Zapier and I'm trying to pull out each buyer individually from the response.

"offer_detail": {
    "address_line_one": "New 7 Poor House St. Changes",
    "address_line_two": "Boca Raton, FL 33428sf",
    "state": "Gujarat",
    "zip_code": "400068",
    "apn": "1238",
    "mls": "1238",
    "type_of_property": "Single Family Home",
    "buyer_details": [
        {
            "id": 1,
            "type": "entity",
            "fName": "karthik",
            "lName": "leo9",
            "entName": "123 Buyer",
            "email": "karthik@gmail.com"
        },
        {
            "id": 2,
            "type": "person",
            "fName": "leo9er23",
            "lName": "studioer",
            "entName": null,
            "email": "leo9@gmail.com"
        }
    ],
    "seller_details": [
        {
            "id": 1,
            "type": "person",
            "fName": "Jignesh",
            "lName": "leo93",
            "entName": null,
            "email": "jignesh@gmail.com"
        }
    ],

What I've Done in Zapier Step 1: Catch Raw Webhook Step 2: Run Code by Zapier (Javascript)

Input Data: rawJsonData <--- This references my raw data

Code

    var obj = JSON.parse(inputData.rawJsonData); //Data will now function like a json object

return json;
enter code here

How do I go about creating an object for each of these buyers so that when I want to create a slack message, they'll show appropriately?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...