2016-03-30 18 views
0

私の複数ステップZapsの1つに、ステップ2としてZapier.Webhook-GETがあります。 ステップ3 Zapier.RunScript-Javascriptです。前の手順(Webhook-GET)からintire JSONオブジェクトとしてCode(Zapier)の入力変数を設定するには

手順3で必要な入力変数としてステップ2の結果のJSONオブジェクトを設定する方法を見つけることができません。オプションのリストには、子フィールドとネストされたフィールドのみが表示されますが、オブジェクトルートから。

答えて

0

私はZapierが特にそうとは思わないと思います。

これは完全に機能する代替方法です:ステップ3のスクリプトにGETを入れ、fetch!

//Put in your url with querystring 
var url = "https://somewhere.com/rest?para1=value1"; 

//Add the method and headers here 
fetch(url, {method: "GET", headers: {"Content-Type": "application/json"}}) 
.then(function (response) { 
    console.log(response); 
    return response.json(); 
}).then(function (data) { 
    //This is the entire JSON. Put your code here 
    // Remember to do a callback! Do not set to "output" 
    console.log(data); 

    //This will return data as output 
    callback(null, data); 
}); 

//Code here will execute BEFORE code within the then functions because it's asynchronus 

フェッチの詳細については、このリンクを参照してください:このことができますhttps://github.com/bitinn/node-fetch/tree/32b60634434a63865ea3f79edb33d17e40876c9f#usage

希望を

はここでの例です!

関連する問題