Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
MattRiley
New Member

Power Query Error

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

5 REPLIES 5
MattRiley
New Member

MattRiley_0-1616058354238.jpeg

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. 

Vera_33
Resident Rockstar
Resident Rockstar

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?

MattRiley_2-1616068894092.jpeg

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. 

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors