1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SPOリストの複数選択可能な選択肢列の値IDの取得方法

1
Posted at

複数選択可能な選択肢列の、0:hoge、1:fuga、2:fooの「0,1,2」の値はクラウドフローの動的なコンテンツで取得できないため、式を記述して取得可能か試しました。

試すときは手動ボタントリガーのクラウドフローを作成して、対象の選択肢列をもつリストをSPOコネクタの「項目の取得」アクションを追加し、適当なアイテムIDを入力してテスト実行すると実行履歴から出力のJSONを取得できます。

{
  "@odata.etag": "\"57\"",
  "ItemInternalId": "28",
  "ID": 28,
        ・
        ・
        ・
  "選択肢列名": [
    {
      "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
      "Id": 0,  //動的なアクションでは取得できない
      "Value": "hoge"
    },
    {
      "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
      "Id": 1, //動的なアクションでは取得できない
      "Value": "fuga"
    },
    {
      "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
      "Id": 2, //動的なアクションでは取得できない
      "Value": "hoo"
    }
  ],
  "選択肢列名@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)",
  "選択肢列名#Id": [
    0,
    1,
    2
  ], //動的なアクションでは取得できない
  "選択肢列名#Id@odata.type": "#Collection(Int64)",
    ・
    ・
    ・

こんな感じで、配列のJSONの後ろに

  "選択肢列名#Id": [
    0,
    1,
    2
  ],

というのがあります。これを使います。式にすると

outputs('項目の取得')?['body/選択肢列名#Id']

となります。

ひとつひとつ指定したい場合は

outputs('項目の取得')?['body/選択肢列名#Id']?[0]
outputs('項目の取得')?['body/選択肢列名#Id']?[1]
outputs('項目の取得')?['body/選択肢列名#Id']?[2]

となります。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?