excel 来自Web Power查询的数据未在MacBook Pro上刷新

umuewwlo  于 2023-05-08  发布在  Mac
关注(0)|答案(1)|浏览(277)

我通过在Windows计算机上使用Web查询从一个网站获取数据。在我得到数据后,我保存了文件并将其发送到我的Mac。当我试图刷新Excel工作表时,它告诉我这一点
Expression.Error]导入Web.页与任何导出都不匹配。你错过了一个模块引用吗?

下面是查询。在Windows计算机上工作正常。

let

    SvcUrl = "https://accounts.zoho.com/oauth/v2/token?refresh_token=****.******47892*******************&client_id=*********&client_secret=*********&redirect_uri=https://www.google.com&grant_type=refresh_token",

    Content = "{}",

    Response= Web.Contents(SvcUrl, 

    [
    Content=Text.ToBinary(Content),
    Headers=[#"Content-Type" = "application/json"]
    ]
    ),

    Json = Json.Document(Response),
    AccessToken = Json[access_token],
    AccessTokenHeader = "Zoho-oauthtoken " & AccessToken,
    Source = Json.Document(Web.Contents("https://www.zohoapis.com/invoice/v3/customerpayments", [Headers=[Authorization=AccessTokenHeader, #"X-com-zoho-invoice-organizationid"="76077****", #"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"]])),
    customerpayments1 = Source[customerpayments],
    #"Converted to Table" = Table.FromList(customerpayments1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"payment_id", "payment_number", "invoice_numbers", "date", "payment_mode", "payment_mode_formatted", "amount", "bcy_amount", "unused_amount", "bcy_unused_amount", "description", "reference_number", "customer_id", "customer_name", "created_time", "last_modified_time", "last_four_digits", "gateway_transaction_id", "payment_gateway", "bcy_refunded_amount", "applied_invoices", "has_attachment", "documents", "custom_fields_list", "tax_amount_withheld", "payment_type", "settlement_status"}, {"Column1.payment_id", "Column1.payment_number", "Column1.invoice_numbers", "Column1.date", "Column1.payment_mode", "Column1.payment_mode_formatted", "Column1.amount", "Column1.bcy_amount", "Column1.unused_amount", "Column1.bcy_unused_amount", "Column1.description", "Column1.reference_number", "Column1.customer_id", "Column1.customer_name", "Column1.created_time", "Column1.last_modified_time", "Column1.last_four_digits", "Column1.gateway_transaction_id", "Column1.payment_gateway", "Column1.bcy_refunded_amount", "Column1.applied_invoices", "Column1.has_attachment", "Column1.documents", "Column1.custom_fields_list", "Column1.tax_amount_withheld", "Column1.payment_type", "Column1.settlement_status"})
in
    #"Expanded Column1"
n3ipq98p

n3ipq98p1#

Excel for Mac基本上是Excel for Windows的发育不良版本。就我个人而言,我不会在Mac上使用Excel,但出于这个原因,非常基本的东西。
除其他外,它不提供与Windows版本相同的连接器列表。当前不支持连接到Web资源(see also this thread)。
当您在Power Query中启动一个新的查询时,您将建立一个到您选择的任何源的数据连接。你可以通过“获取数据”功能来实现,当你这样做时,你会被提示进行连接设置,例如用户名/密码等。这是一个例子:

您可能意识到连接器在Excel for Mac中不可用,并认为,让我们只使用Windows查询,在Mac上打开一个空白查询,它应该可以正常工作。原因是您尚未在Power Query中建立连接。您在查询M代码中列出了一个,但Power Query不知道源存在,因此您得到了错误。
我只能找到this workaround,但我自己没有测试过。

相关问题