使用强大的表单API使用另一个输入表单更新包含数据的一个表单

时间:2019-05-23 14:18:09

标签: wordpress api formidable

我有两种形式。一个包含用户数据和以下字段

代码XXXXXX 二手的FALSE 获胜者TRUE

用于优惠券代码。有些代码是赢家,有些则不是。

我还有另一种用于收集用户输入的表格。

我正在使用查找字段来检查代码是否为赢家,如果允许,则允许用户提交表单。

我拥有强大的表单API,无法弄清楚API

当代码使用一次时,我需要将第一种形式的used字段更改为TRUE。

就是这样。

我在他们的文档中尝试了一些方法,但无济于事。

任何人都对此有经验吗?

我尝试遵循以下步骤:

  

更新条目#

     

如果您要更新同一站点或其他站点上的条目   具有API插件的网站,请按照以下步骤操作。请注意   必须在两个站点上都安装“强大”和API插件。

Go into edit the form that will send the data and trigger the entry update.
Click on 'Settings' → 'Actions & Notifications' → 'Send API Data'. This will add an API action to your form.
Insert the following in the Notification URL box:

yoursite.com/wp-json/frm/v2/entries/25

Replace yoursite.com with the site that holds the entry you would like to update. Replace 25 with the ID of the entry to update. You can
     

还可以通过View动态获取条目ID。例如,您可以   从您将要更新的表单创建一个Single Entry View,放置   [id],然后添加一个过滤器,内容类似于“ UserID   等于[get param = u_id]”。然后您可以将其插入到   通知网址:

yoursite.com/wp-json/frm/v2/entries/[display-frm-data id=x u_id="[y show=ID]"]

Replace x with the ID of the View and replace y with the ID of the userID field in your current form. This would update the first entry
     

由当前用户创建。注意:仅当您   更新同一站点上的条目,但如果要更新   在另一个站点上输入。       将接收站点的API密钥插入“基本身份验证”框中。       插入键/值对,仅包括要在接收表单中更新的字段。您的键/值对可能看起来像这样:       键值       rt2yml [2018]       fieldkeyhere [2019]

Make sure to use the receiving field key in the "Key" column. Use the sending field key or ID in the "Values" column.
Select 'PATCH' as the Method. This will ensure that only the posted fields are updated.
That's it! Now try submitting an entry in the sending form and see if it updates the entry in the receiving form.
     

注意:如果要发送日期字段值,请确保您   在简码中使用[x format =“ Y-m-d”]。

0 个答案:

没有答案