5

用DataVerse的entity来控制Powerautomate的启动时间

 1 year ago
source link: https://blog.51cto.com/u_15813130/5766778
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

用DataVerse的entity来控制Powerautomate的启动时间

精选 原创

整体思想为DataVerse里创建一条记录,记录包含对应的固定Powerautomate(A)的启动时间,当这条记录里设置的启动时间发生变化时,触发更改Powerautomate(A)启动时间的另一个Powerautomate(B),在Powerautomate(B)里,先取得Powerautomate(A)的定义,再把定义里的启动时间更新为记录的时间。

前边触发的部分略,Powerautomate(A)的取得使用Power Automate Management的Get Flow,返回值里包含了Flow的定义definitionSummary

 ​Power Automate Management - Connectors | Microsoft Learn​

通过Parse JSON和Compose,以及setProperty function来更新Flow的定义里边的startTime,

用DataVerse的entity来控制Powerautomate的启动时间_启动时间

方便后边的更新,把Flow定义的json解析,这里先执行一次,取得返回的json内容,再用sample解析

用DataVerse的entity来控制Powerautomate的启动时间_json_02

由于setProperty只能设定一层,所以这里需要逐层设定,直到更新了定义为止

 ​Reference guide for expression functions - Azure Logic Apps | Microsoft Learn​

先更新recurrence里的startTime值

@{setProperty(body('JSON_の解析')?['triggers']?['開始']?['recurrence'],'startTime','2022-08-30T00:00:00Z')}

用DataVerse的entity来控制Powerautomate的启动时间_启动时间_03

再更新trigger名为【開始】里的recurrence

@{setProperty(body('JSON_の解析')?['triggers']?['開始'],'recurrence',outputs('作成_3'))}

用DataVerse的entity来控制Powerautomate的启动时间_启动时间_04

更新triggers

@{setProperty(body('JSON_の解析')?['triggers'],'開始',outputs('作成_4'))}

用DataVerse的entity来控制Powerautomate的启动时间_json_05

更新Flow的定义definition(这里包含的Flow的全部内容)

@{setProperty(outputs('フローの取得')?['body/properties/definition'],'triggers',outputs('作成_5'))}

用DataVerse的entity来控制Powerautomate的启动时间_json_06

Flow的定义更新后,就可以使用UpdateFlow来更新Flow了,

Flow定义设定:@{outputs('作成_6')}

 ​Power Automate Management - Connectors | Microsoft Learn​

用DataVerse的entity来控制Powerautomate的启动时间_启动时间_07
  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK