LoginSignup
3
4

More than 1 year has passed since last update.

PowerAutomate: クリップボードでフローをコピー&ペーストして簡単共有

Last updated at Posted at 2021-10-27

背景

Power Automate の共有の仕方としては、以下のような共有方法がありますが、クリップボードを使うと JSON で共有出来まるので、Qiitaなどと相性がいいですね、というお話。

  1. 所有者共有
  2. 実行専用共有
  3. Zip Export/Import
  4. メールで送付して、Zip Import
  5. Template 化して
  6. Solution 化して

Desktop 版の JSON 共有は以下で

クリップボードの使い方

  1. クリップボードにコピー
    image.png
  2. 以下のような JSON が取得出来てる
    image.png
  3. アクション選択する際の Tab を MyClipboard に切り替えて貼り付け
    image.png
  4. あとは、普通の Action と同様に選択すると、展開されます
    image.png

Scope で囲っておくことで、Trigger以外の全Actions をコピペ対象に出来ます。

貼り付けSample

貼り付けSample_InputValidation
{
  "id": "1316db62-ad5b-4102-965a-5e4b-1ce905c7",
  "brandColor": "#8C3900",
  "connectionReferences": {
    "shared_teams": {
      "connection": {
        "id": "/providers/Microsoft.PowerApps/apis/shared_teams/connections/shared-teams-864099d5-54a7-4002-93b6-565ecf481128"
      }
    }
  },
  "connectorDisplayName": "Control",
  "icon": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=",
  "isTrigger": false,
  "operationName": "Scope",
  "operationDefinition": {
    "type": "Scope",
    "actions": {
      "Post_adaptive_card_in_a_chat_or_channel": {
        "type": "OpenApiConnection",
        "inputs": {
          "host": {
            "connectionName": "shared_teams",
            "operationId": "PostCardToConversation",
            "apiId": "/providers/Microsoft.PowerApps/apis/shared_teams"
          },
          "parameters": {
            "poster": "Flow bot",
            "location": "Chat with Flow bot",
            "body/recipient": "@{triggerOutputs()['headers']['x-ms-user-email-encoded']};",
            "body/messageBody": "{\n    \"type\": \"AdaptiveCard\",\n    \"version\": \"1.3\",\n    \"msteams\": {\n        \"width\": \"full\"\n    },\n    \"body\": [\n        {\n            \"type\": \"Input.Text\",\n            \"label\": \"ItemName を入れてください\",\n            \"isRequired\": true,\n            \"id\": \"InputName\",\n            \"placeholder\": \"Alphabetical12\",\n            \"regex\": \"^\\\\w+\\\\d{2}$\",\n            \"errorMessage\": \"アルファベット一文字以上に続き二桁の数字を入れてください。\",\n            \"maxLength\": \"8\"\n        },\n        {\n            \"type\": \"Input.Number\",\n            \"placeholder\": \"25\",\n            \"label\": \"年齢を入れてください\",\n            \"id\": \"InputAge\",\n            \"errorMessage\": \"20-99歳で\",\n            \"isRequired\": true,\n            \"min\": \"20\",\n            \"max\": \"99\"\n        },\n        {\n            \"type\": \"Input.Date\",\n            \"errorMessage\": \"2021/11/1 より後で\",\n            \"min\": \"2021/11/1\",\n            \"max\": \"2021/12/1\",\n            \"id\": \"InputDate\"\n        },\n        {\n            \"type\": \"Input.Time\",\n            \"errorMessage\": \"12:00 - 14:00 で\",\n            \"min\": \"12:00\",\n            \"max\": \"14:00\",\n            \"id\": \"InputTime\"\n        },\n        {\n            \"type\": \"ActionSet\",\n            \"actions\": [\n                {\n                    \"type\": \"Action.Submit\",\n                    \"title\": \"Action.Submit\"\n                }\n            ]\n        }\n    ],\n    \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\"\n}"
          },
          "authentication": {
            "type": "Raw",
            "value": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"
          }
        },
        "runAfter": {}
      }
    },
    "runAfter": {}
  }
}

keyword

to share with clipboard

3
4
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
3
4