Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi all,
I am a relative novice at all of this and have been provided with a query to use when importing data. They cannot help more than that but I was hoping someone could point me in the right direction.
When inputting this into Advanced Query Editor I am getting an error on the bold highlighed text below. Any ideas what this should be replaced with?
Thank in advance for any help.
let
Source = Json.Document(Web.Contents("http://api.XXXXcom/api/v1/survey?limit=1", [Headers=[X_XXX_APITOKEN=XXXXX]])),
AllPages = {1..(Number.IntegerDivide(Source[total]-1, 1000)+1)},
AllPagesList = Table.FromList(AllPages, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
AllPagesListText = Table.TransformColumnTypes(AllPagesList,{{"Column1", type text}}),
AllPagesListWithData = Table.AddColumn(AllPagesListText, "Data", each getSurveyPage([Column1])),
Data = Table.ExpandTableColumn(AllPagesListWithData, "Data", {"_id", "survey_type_code", "closed", "rating", "contact_email", "contact_name", "_updated_at", "_created_at", "ip_address", "reviewed", "employees", "surveyTagsCompany", "surveyTagsCustomer", "inactive", "rating_label", "comment", "ticket_num"}, {"_id", "survey_type_code", "closed", "rating", "contact_email", "contact_name", "_updated_at", "_created_at", "ip_address", "reviewed", "employees", "surveyTagsCompany", "surveyTagsCustomer", "inactive", "rating_label", "comment", "ticket_num"})
in
Data
Unfortunately this is all I am getting for an error message and I have no M code. The supplier of the api do not have any PowerBi knowledge so cannot help me any further.
Hi, @MattRiley
Do you have a query called 'getSurveyPage'? It seems the wrong reference caused this error.
Best Regards
Allan
Unfortunately not. I assumed that was supposed to be replaced by something else but I havent been able to establish what. With the exception of the PowerQuery script above, the only other information they are able to provide is a short how-to guide as below:
https://get-help-tnt.crewhu.com/hc/en-us/articles/360041925673-Power-BI-Integration-Open-API
Unfortunately doing it this was has a limit of only 100 lines so isnt going to be too helpful for me.
Hi @MattRiley
What is the error message? It looks like getSurveyPage is a customized function, so do you have the M code for it since it is not included in this query?
Unfortunately this is all I am getting for an error message and I have no M code. The supplier of the api do not have any PowerBi knowledge so cannot help me any further.
| User | Count |
|---|---|
| 16 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |