【问题标题】:How to set the value of a calculated field when creating an item via the PODIO API通过 PODIO API 创建项目时如何设置计算字段的值
【发布时间】:2020-02-07 17:04:27
【问题描述】:

当我使用 API 创建项目时,我希望 podio 对计算字段执行计算

我正在使用 PODIO API 从应用创建项目。项目的其中一个字段是计算字段,是其他 3 个字段的串联。

如果我只设置这三个字段,则创建项目,但新创建的项目中的计算字段保持为空。 但是,如果我执行连接并尝试在创建项目时自己设置计算字段,podio 会返回错误“无法直接为 id 为 XXX 的字段设置值”,并且根本不会创建项目。

我正在使用 node 来执行请求,没有任何 podio sdk。 API 调用没问题,因为我可以在不尝试在 post 请求中设置计算字段时创建项目。

// field id 178064352 is the calculated one
let attributes = {
  '178064352' : [receipt.type + ' / ' + receipt.date + ' / ' + receipt.total],
  '178064354' : [receipt.date], 
  '178064355' : [receipt.type],
  '178064356' : [receipt.total]
}
this.http.post(`${this.PODIO_API_URL}/item/app/${appId}/?silent=true`, {fields:attributes});

如何让 podio 执行计算?还是用我自己计算的值强制填充值?

【问题讨论】:

    标签: api calculated-field podio


    【解决方案1】:

    好的,我上次尝试成功了:属性中的计算字段根本不存在。 Podio 在收到其他字段时计算它。

    let attributes = {
      // '178064352' : [receipt.type + ' / ' + receipt.date + ' / ' + receipt.total],
      '178064354' : [receipt.date], 
      '178064355' : [receipt.type],
      '178064356' : [receipt.total]
    }
    this.http.post(`${this.PODIO_API_URL}/item/app/${appId}/?silent=true`, {fields:attributes});
    

    【讨论】:

      猜你喜欢
      • 2017-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      相关资源
      最近更新 更多