Skip to Content
学习 Microsoft Power Automate
book

学习 Microsoft Power Automate

by Paul Papanek Stork
May 2025
Intermediate to advanced
354 pages
4h 49m
Chinese
O'Reilly Media, Inc.
Content preview from 学习 Microsoft Power Automate

第 7 章 故障排除技巧 故障排除技巧

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

无论是独立运行还是与其他 Power Platform 应用程序集成,Power Automate 流程都是为业务问题构建低代码/无代码解决方案的强大工具。在第 6 章中,您学习了如何将流程与其他应用程序集成,使其更加有效。但是,这些解决方案只有在运行时不会出现 错误,才会有所帮助。在使用 Power Automate 的过程中,您偶尔会遇到可能由多种问题导致的错误。这些错误可能是由于编写表达式时的语法错误、数据质量不一致或设计流程时的逻辑错误造成的。在本章中,您将学习从流程中查找和删除错误的不同方法。我还将向你展示如何设计流程,以自动适应运行过程中可能发生的错误。

查看运行历史

每次 流量运行时,都会记录历史日志。这些日志保存 28 天。图 7-1显示了流程详细屏幕上的典型历史日志。每个日志条目都显示了流程的运行时间、运行时间以及是否成功。您还可以使用列表顶部的编辑列链接,在视图中添加流输入参数的列。

Flow run history logs
图 7-1. 流量运行历史记录

过滤 "所有运行 "视图

28 天的运行历史记录显示了流量成功或失败运行的所有情况。但有两种特殊情况不包括在主视图中。第一种情况是流程使用了基于轮询的触发器,但由于触发器轮询时没有新数据而没有触发。第二种情况是由于触发器本身出错而没有触发流程。选择 28 天历史记录列表右上角的 "所有运行 "视图,即可访问这两种运行。在 "所有运行 "视图中,您可以过滤任何类型的运行,包括触发器未触发的运行、检查(无新数据)和检查失败的运行。

从这些列表中选择一个流程,就会显示该流程中每个操作的运行状态。图 7-2显示了包含一些失败操作的历史日志示例。

Sample flow run with error
图 7-2. 有误差的样流运行

在历史日志中,您会看到以下符号:

  • 带有复选标记的绿色圆圈表示操作已成功完成。

  • 带感叹号的红圈表示操作失败。

  • 带 X 的灰色圆圈表示未执行的操作。

提示

失败的容器操作(如作用域、条件或循环)中的任何操作如果失败,都会被标记为失败。通常需要深入查找最内层的失败操作,才能获得有意义的错误信息。对于循环,可以通过链接直接跳转到下一个或上一个错误。

展开失败的操作会显示该操作抛出的错误信息。查看历史记录可以帮助您找出流程失败的原因。这通常是排除流程故障的第一步。

阅读错误信息

确定流程的故障点后,阅读整个错误信息至关重要。人们通常只读到第一行 "无法处理动作中的模板语言表达 "之类的内容,就认为这就是错误信息。但这并不能说明什么。如果你阅读了图 7-2 中的完整错误信息,你就会看到"'地址'不存在,可用属性为'城市、州'"。这就提供了所需的详细信息。在这种情况下,数据中的地址字段为空,因此在尝试从必应获取地址时无法使用。现在你知道错误是由于数据丢失造成的,可以开始查找该字段不可用的原因了。错误信息可能又长又隐晦,但如果阅读完整条信息,它们通常会为你指出正确的方向。

常见错误 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

使用 Microsoft Power Platform 构建解决方案

使用 Microsoft Power Platform 构建解决方案

Jason Rivera
Citrix XenApp Platinum Edition for Windows: The Official Guide, 4th Edition

Citrix XenApp Platinum Edition for Windows: The Official Guide, 4th Edition

Tim Reeser, Steve Kaplan, Brian Casselman, Alan Wood

Publisher Resources

ISBN: 9798341657816