Skip to content

PowerAutomate

  • 最終更新日: 2026年4月28日
  • 最終更新者: 都築

概要

本文書では、(個人ではなく)会社の業務として使用するPowerAutomateのフローの設定を記載します。

設定

VTポータルでお知らせ投稿・更新時にメール通知

  • 登録アカウント: share@vt-holdings.co.jp
  • フローの種類: Cloud flows
  • フロー図: flow_chart_vt_portal_notify_by_email
  • [SharePoint]When an item is created or modified
    json { "type": "OpenApiConnection", "description": "お知らせのリストにアイテムが登録/更新されたことを検知", "inputs": { "parameters": { "dataset": "https://vtholdings.sharepoint.com", "table": "eab3d8f3-3bc0-40de-8615-765eeeb950a9" }, "host": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline", "connection": "shared_sharepointonline", "operationId": "GetOnUpdatedItems" } }, "recurrence": { "frequency": "Minute", "interval": 5 }, "splitOn": "@triggerOutputs()?['body/value']", "metadata": { "operationMetadataId": "41d9a470-8976-4bb1-8f6e-fc09bb8850e5" } }
  • [Data Operation]Initialize Varialble
    json { "type": "InitializeVariable", "description": "後続の処理に必要な変数を初期化", "inputs": { "variables": [ { "name": "添付ファイル情報", "type": "array" } ] }, "runAfter": {} }
  • [SharePoint]Get attachments
    (アイテムの添付ファイルを取得) json { "type": "OpenApiConnection", "description": "アイテムの添付ファイルを取得", "inputs": { "parameters": { "dataset": "https://vtholdings.sharepoint.com", "table": "eab3d8f3-3bc0-40de-8615-765eeeb950a9", "itemId": "@triggerBody()?['ID']" }, "host": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline", "connection": "shared_sharepointonline", "operationId": "GetItemAttachments" } }, "runAfter": { "Initialize_variable": [ "Succeeded" ] } }
  • Condition
    json { "type": "If", "description": "アイテムの属性「メール通知」がチェックされているかどうかの判定", "expression": { "or": [ { "equals": [ "@triggerBody()?['OData__x30e1__x30fc__x30eb__x901a__x770']", 1 ] }, { "equals": [ "@triggerBody()?['OData__x30e1__x30fc__x30eb__x901a__x770']", true ] } ] }, "actions": { "For_each": { "type": "Foreach", "description": "全添付ファイルを取得するループ", "foreach": "@outputs('Get_attachments')?['body']", "actions": { "Get_attachment_content": { "type": "OpenApiConnection", "description": "添付ファイルを取得", "inputs": { "parameters": { "dataset": "https://vtholdings.sharepoint.com", "table": "eab3d8f3-3bc0-40de-8615-765eeeb950a9", "itemId": "@triggerBody()?['ID']", "attachmentId": "@items('For_each')?['Id']" }, "host": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline", "connection": "shared_sharepointonline", "operationId": "GetAttachmentContent" } } }, "Append_to_array_variable": { "type": "AppendToArrayVariable", "description": "作成した配列変数に添付ファイルを格納", "inputs": { "name": "添付ファイル情報", "value": { "Name": "@items('For_each')?['DisplayName']", "ContentBytes": "@body('Get_attachment_content')" } }, "runAfter": { "Get_attachment_content": [ "Succeeded" ] } } } }, "Send_an_email_(V2)": { "type": "OpenApiConnection", "description": "取得したアイテムのアイテム、タイトル、添付ファイルをもとにメールを送付。\nアイテム作成日時が更新日時より10秒以上古い場合は、件名に「(更新)」の文言を追加", "inputs": { "parameters": { "emailMessage/To": "news_from_vtportal@vt-holdings.co.jp", "emailMessage/Subject": "[VTポータルより]@{if(lessOrEquals(div(sub(ticks(triggerOutputs()?['body/Modified']), ticks(triggerOutputs()?['body/Created'])),10000000),10),'','(更新)')}@{triggerBody()?['Title']}", "emailMessage/Body": "<p class=\"editor-paragraph\">@{triggerBody()?['Body']}</p><br>", "emailMessage/From": "share@vt-holdings.co.jp", "emailMessage/Attachments": "@variables('添付ファイル情報')", "emailMessage/Importance": "Normal" }, "host": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365", "connection": "shared_office365", "operationId": "SendEmailV2" } }, "runAfter": { "For_each": [ "Succeeded" ] }, "metadata": { "operationMetadataId": "ad2326d0-3322-4a49-89ce-b10502ae1f90" } } }, "else": { "actions": {} }, "runAfter": { "Get_attachments": [ "Succeeded" ] } }

参考

以上です。

目次へ