Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

[Expression.Error] 3 arguments were passed to a function which expects 1.Automatic refresh Failed

Hi,

Automatic refresh failed in power bi service online. It throwing an error [Expression.Error] 3 arguments were passed to a function which expects 1. Table BlogPostTotal.

 

The below Power query I have created in custom connector. It works in power bi desktop but not works in automatic refresh in power bi online. Please advise.

 

[DataSource.Kind="HubSpot", Publish="HubSpot.UI"]

shared HubSpot.Contents = Value.ReplaceType(HubSpotCore.Contents, type function (#"Hubspot Connector" as Uri.Type) as any);

shared HubSpotCore.Contents = () =>

let
source = #table({"Name", "Data", "ItemKind", "ItemName", "IsLeaf"}, {
{ "Blog Posts Total", BlogPostTotal(), "Table", "Table", true }
}),
navTable = Table.ToNavigationTable(source, {"Name"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
in
navTable;

BlogPostTotal = () as table =>
let
finalUrl = "https://api.hubspot.com/activities/v2/reports/blog-posts/total?portalId=4490686&clienttimeout=10000&sort=rawViews&sortDir=DESC&offset=0&useForeignIndex=true",
portalId=4490686&clienttimeout=10000&start=20190126&end=20190224&sort=rawViews&sortDir=DESC&limit=100&offset=0&useForeignIndex=true",
content = Web.Contents(finalUrl),
#"Imported JSON" = Json.Document(content),
#"Converted to Table" = Record.ToTable(#"Imported JSON")

in
#"Converted to Table";



 

Thanks

Vinoth

2 Replies