Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zapier:如何使用Zapier将数据从ScheduleOnce发送到my Node.js web app_Zapier - Fatal编程技术网

Zapier:如何使用Zapier将数据从ScheduleOnce发送到my Node.js web app

Zapier:如何使用Zapier将数据从ScheduleOnce发送到my Node.js web app,zapier,Zapier,以下是我的工作流程: 此人单击我的ScheduleOnce链接并安排会议 完成ScheduleOnce预订表单后,该人员单击完成按钮 单击此“完成”按钮时,此人将重定向到显示应用程序页面的节点JS web应用程序。此应用程序页面需要使用ScheduleOnce页面中的信息自动填充。 在第2步和第3步之间是Zapier的用武之地。我正在尝试使用Zapier从ScheduleOnce预订中捕获数据,它是。然后,我尝试使用Zap将数据发送到用户重定向到的页面,以自动填充某些字段 我原以为使用代码Jav

以下是我的工作流程:

此人单击我的ScheduleOnce链接并安排会议 完成ScheduleOnce预订表单后,该人员单击完成按钮 单击此“完成”按钮时,此人将重定向到显示应用程序页面的节点JS web应用程序。此应用程序页面需要使用ScheduleOnce页面中的信息自动填充。 在第2步和第3步之间是Zapier的用武之地。我正在尝试使用Zapier从ScheduleOnce预订中捕获数据,它是。然后,我尝试使用Zap将数据发送到用户重定向到的页面,以自动填充某些字段

我原以为使用代码Javascript功能可以工作,但事实并非如此。然后我考虑使用StoreClient选项或API。我只是对如何让流工作以访问数据和自动填充下一个重定向页面上的字段感到困惑

我们将非常感谢您的帮助

以下是Javascript选项的代码:

    var store = StoreClient("Secret");
    store
        .setMany({firstName: inputData.firstName, lastName: inputData.lastName, email: inputData.email, mobilePhone: inputData.mobilePhone, otherPhone: inputData.otherPhone, businessWebsite: inputData.businessWebsite})
        .then(function() {
            return store.getMany('firstName', 'lastName', 'email', 'mobilePhone', 'otherPhone', 'businessWebsite');
        })
        .then(function() {
            callback();
        })
        .catch(callback);

大卫,来自Zapier平台团队。这是一个很酷的用例,可能是可行的。您需要记住的是,Zapier完全独立于用户运行,因此交互必须是间接的。Zapier不能将用户重定向到任何地方,它只能存储数据以响应按钮的按下

在您的情况下,您可以跳过setMany之后的所有内容,因为您没有尝试使用zap中的值;您只需要存储它们,并验证操作是否已完成且没有错误

var store = StoreClient("Secret");
    store
        .setMany({firstName: inputData.firstName, lastName: inputData.lastName, email: inputData.email, mobilePhone: inputData.mobilePhone, otherPhone: inputData.otherPhone, businessWebsite: inputData.businessWebsite})
        .catch(callback);
您需要解决几个问题:

速度用户将在zap完成之前到达您的登录页,因为它必须进行几次HTTP往返并执行代码。你会想给他们播放3秒钟的加载gif,或者放一条等待的消息,让他们刷新目的地 填充页面。我不确定目的地的性质,最好的情况是,它是您控制的服务器,但需要向store.zapier.com发出http请求以检索存储的数据并在视图中显示它。这很容易,如果 识别用户。您将需要某种方法来识别被重定向到存储在StoreClient中的数据的用户。如果两个用户连续快速填写表单,则第二个用户当前将覆盖第一个用户。另外,它似乎是半敏感的数据,你不想让你网站上的任何人都能看到。为此,您可能希望将所有数据存储为JSON字符串,该字符串由用户的电子邮件或其他独特的内容键入。这样,当用户完成表单时,我将被重定向到yoursite.com/landing?电子邮件=david@zapier.com,后端知道如何查找david@zapier.com在存储区中输入,可以使用正确的信息渲染视图。 为此,我将代码调整为以下内容:

var store = StoreClient("Secret");
    store
        .set(inputData.email, JSON.stringify({firstName: inputData.firstName, lastName: inputData.lastName, email: inputData.email, mobilePhone: inputData.mobilePhone, otherPhone: inputData.otherPhone, businessWebsite: inputData.businessWebsite}))
        .catch(callback);

希望这能为你指明正确的方向。你的工作流程相当复杂,但我敢打赌你一定能做到

太好了,谢谢!因此,我将Zapier代码更新如下:var customerInfo={firstName:inputData.firstName,lastName:inputData.lastName,email:inputData.email,mobilePhone:inputData.mobilePhone,otherPhone:inputData.otherPhone,businessWebsite:inputData.businessWebsite};变量存储=StoreClientT5@2qaifla; store.setinputData.email,JSON.stringifycustomerInfo.catchcallback。但是我继续得到Zapier测试代码的一个错误:-错误:您必须返回单个对象或对象数组。有什么想法吗?哦,对不起。你得找个地方回电话我总是忘了那部分。因此,在设置之后,但在捕获之前,添加.then函数{callbacknull,{ok:true}},让跑步者知道你已经完成了,一切都好了。另外,如果这是你真正的秘密,你会想继续使用一些不同的仍然是秘密的东西。啊!!美丽的成功了!是的,我的秘密实际上是一个非常秘密的秘密。既然这样,要访问存储对象中的数据,我只需使用API调用store.zapier.com/API/records?secret=12345&key=firstName&key=lastName&key=email&key=modilePhone&key=otherPhone&key=businessWebsite,它似乎也能工作。在重定向按钮上,我需要设置电子邮件=email@email.com输入重定向url是否正确?是的,表单需要发送信息!