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 have a function in a Dataflow Gen1 (code below). I just updated the function to include the Datefilter argument.
With the update the primary query (RawData) where this function is called works fine, all steps complete. There are some additional queries that Reference the RawData query. The subsequent queries isolate specific columns with list records and then expand the lists. I then filter out any null/blank rows. The problem is on all the sub queries, on the filter step an error is being returned that says:
The error reference is clearly in relation to the function code shown below. However, the function is correct and the RawData query is correct, I don't understand why this error is being triggered on filter.
If I go into Details this is what I see. If I copy paste the Mash-up, everything looks correct, including the agruements being passed. It feels like somehow there is a mix-up between old and new here, as previously only three aguements were passed and with the most recent update four argument need (and should be) passed. As you can see in the function code most of this is interalized in the function and the only thing being passed into the function is the object type. In reality this function could be fully integrated into the RawData query, its mostly isolated so that the pattern can easily be re-used for other object types and endpoints from the vendor (Freshdesk).
Any thoughts as to what is happening here that is throwing things off?
(URLobjectType as text)=>
let
DateFilter =
DateTime.ToText(
DateTime.From(
Date.AddYears(
Date.StartOfYear(
DateTime.Date(
DateTime.LocalNow()
)
),
-1
)
),
[Format="yyyy-MM-dd'T'HH:mm:ss'Z'"]
),
GetData = (
URLobjectType as text,
objectsPerPage as text,
pageNo as number,
DateFilter as text
) =>
let
PageNum = Number.ToText(pageNo),
Response = Json.Document(
Web.Contents(
"https://companyurl.freshdesk.com/api/v2/",
[
RelativePath = URLobjectType,
Query = [per_page = objectsPerPage, page = PageNum, updated_since = DateFilter, include = "stats"]
]
),
65001
)
in
Response,
IterateEndPoint =
List.Generate(
() => [ pageNo = 1, Data = GetData( URLobjectType, "100", 1, DateFilter) ],
each not List.IsEmpty([Data]),
each [
pageNo = [pageNo]+1,
Data = GetData( URLobjectType, "100", [pageNo])
],
each [Data]
)
in
IterateEndPoint
Solved! Go to Solution.
Finally found my mistake in my own code. Forgot that the function was called twice in List.Generate, and my eyes passed over it completely. Sigh... 'as you were'.
Finally found my mistake in my own code. Forgot that the function was called twice in List.Generate, and my eyes passed over it completely. Sigh... 'as you were'.