The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I created a function to do paginated API calls, but the output is containing %20 instead of a space, which the endpoint is not accepting.
getProjectURIpaginatedX
(projectNo as text, objectType as text, attrList as text, topVal as number, skipVal as number)=>
let
GetWebContents =
Web.Contents(
"https://api-us.drofus.com/api/company/",
[
RelativePath= Text.Replace(
projectNo
& "/" & objectType
& "?$select=" & attrList
& "&$top=" & Number.ToText(topVal)
& "&$skip=" & Number.ToText(skipVal),
"%20", " ")
]
),
GetBody = Json.Document(GetWebContents)
in
GetBody
I tried inserting a Text.Replace on the RelativePath, but I still get a 400 HTTP error.
Thank you for any advice!
Solved! Go to Solution.
The 400 http error was not due to the %20 but due to a trailing comma and space in the AttrList column.
My apologies.
The 400 http error was not due to the %20 but due to a trailing comma and space in the AttrList column.
My apologies.
Here is the query that is calling the function:
The column AttrList was generated with grouping Lines.ToText.
= Table.Group(#"01addNdxGroup", {"ndxGroup"}, {{"attr", each Lines.ToText(List.Sort(List.Distinct([dRofus.ID])), ", "), type text}})