如何在 Podio Globi webhook 中获取多选类别的 ID?

问题描述

我在跑道上将 Webhook 设置为多选字段。

我当前的代码使用此类别字段的“文本 X Y Z J”,效果很好。

如何将“X Y Z J”更改为类别 ID:1 2 3 4 ?

文本 X = ID 1,文本 Y = ID 2,文本 Z = ID 3,文本 J = ID 4。

附上沙箱信息。

提前致谢。

当前代码

foo();
function foo(){
$result='';
if ([(WebHook) fields::5::value::0]=="o1") {
  if ($result=='') {$result="X";}
  else {$result=$result.','."X";}
}
if ([(WebHook) fields::5::value::0]=="o2") {
  if ($result=='') {$result="Y";}
  else {$result=$result.','."Y";}
}
if ([(WebHook) fields::5::value::1]=="o3") {
  if ($result=='') {$result="Z";}
  else {$result=$result.','."Z";}
}
if ([(WebHook) fields::5::value::1]=="o4") {
  if ($result=='') {$result="J";}
  else {$result=$result.','."J";}
}
return $result;
}

沙盒中的信息

{
      "status": "active","type": "category","field_id": 218404051,"label": "Category5B multi","values": [
        {
          "value": {
            "status": "active","text": "Y","id": 2,"color": "DCEBD8"
          }
        },{
          "value": {
            "status": "active","text": "Z","id": 3,"text": "X","id": 1,"text": "J","id": 4,"color": "DCEBD8"
          }
        }
      ],

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)