Excel Power Query 自定义函数编辑器可捕获未找到的值

问题描述

需要指导为未从 API 找到的 NPI 值添加捕获错误。该表有 2000 个 NPI 编号,其中一些不会在 API 调用中找到。当我运行此函数时,它会在找不到匹配项时停止并出错。我希望函数继续运行并将错误放在适当的行上。

let
Source = (NPPES_API as any) => let
    Source = Json.Document(Web.Contents("https://npiregistry.cms.hhs.gov/api/?version=2.1&number=" & NPPES_API)),results = Source[results],results1 = results{0},addresses = results1[addresses],addresses1 = addresses{0},#"Converted to Table" = Record.ToTable(addresses1),#"Removed Columns" = Table.RemoveColumns(#"Converted to Table",{"Name"}),#"Removed Top Rows" = Table.Skip(#"Removed Columns",4),#"Removed Blank Rows" = Table.SelectRows(#"Removed Top Rows",each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_),{"",null})))
in
    #"Removed Blank Rows"
in
Source

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)