2016-03-30 9 views
0

'dan bir adım JSON nesnesi olarak nasıl ayarlayabilirim Adım adım olarak bir Zapier.Webhook-GET adım adım 2 vardır. Adım 3 Zapier.RunScript-Javascript.Kod (Zapier) giriş değişkeni önceki adım (Webhook-GET)

Adım 3'ten, adım 3 için gereken giriş değişkeni olarak sonuçlanan JSON nesnesini, bir incone JSON nesnesini ayarlamanın bir yolunu anlayamıyorum. Seçenek listesi yalnızca çocukları ve yuvalanmış alanları gösterir, ancak nesneyi almam gerekir kökünden.

cevap

0

Zapier'in buna özellikle izin vereceğine inanmıyorum.

İşte mükemmel bir şekilde çalışabilen bir alternatif: GET'i 3. adım komut dosyasına koyun ve getir'i kullanın!

//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 

getirme konusunda daha fazla için bu bağlantıya bakın: Bu yardımcı olur https://github.com/bitinn/node-fetch/tree/32b60634434a63865ea3f79edb33d17e40876c9f#usage

Umut

İşte bir örnek!

İlgili konular