json 如何格式化从上一个操作返回的日期

bsxbgnwa  于 2023-05-30  发布在  其他
关注(0)|答案(1)|浏览(125)

我在用Power Automate做实验。我有“查找会议时间”操作来查找两个日历的会议时间。
我想采用第一个选项并使用它创建一个事件。
这就是我的流程现在的样子:

这将返回一个错误:

OpenApiOperationParameterTypeConversionFailed. The 'inputs.parameters' of workflow operation 'Create_event_(V4)_2' of type 'OpenApiConnection' is not valid. 
Error details: Input parameter 'item/start' is required to be of type 'String/date-no-tz'. 
The source type/format 'Object' of the value '{"confidence":100.0,"organizerAvailability":"free","attendeeAvailability":[{"availability":"free","attendee":{"emailAddress":{"address":"name@email.com"}}}],"locations":[],"meetingTimeSlot":{"start":{"dateTime":"2023-05-26T10:00:00.0000000","timeZone":"UTC"},"end":{"dateTime":"2023-05-26T10:30:00.0000000","timeZone":"UTC"}}}' 
is not convertible to type/format 'String/date-no-tz'.

我假设它需要整个JSON主体,而不仅仅是“开始”日期时间。
解决这个问题的正确方法是什么?
我试着在JSON对象中导航,但我在第一个节点处被难倒了,它没有名称:

我的尝试看起来像这样:first(outputs('Find_meeting_times_(V2)')?['body/meetingTimeSuggestions']?['parameters']?['item/end']?['meetingtimeslot']?['end']?['datetime'])

1tuwyuhd

1tuwyuhd1#

第一个选项的开始时间的表达式为:

first(outputs('Find_meeting_times_(V2)')?['body/meetingTimeSuggestions'])['meetingTimeSlot']['start']['dateTime']

结束时间为:

first(outputs('Find_meeting_times_(V2)')?['body/meetingTimeSuggestions'])['meetingTimeSlot']['end']['dateTime']

相关问题