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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
karimm
Helper III
Helper III

Best Practice for handling empty API response

Hi All

 

I have several queries that import data from SAAS systems via REST APIs.

I call the API giving a query/filter as input, and parse the API response via several steps (some columns return as records/lists). The final result is a table of X columns.

 

The query usually looks like this:

- Create the query

- Call API

- Expand Field 1

- Expand Field 2

.

.

- Expand Field n

 

In some scenarios, the API response is empty based on the given response. So the query fails on the first Expand step saying "the column 1 of the table wasn't found".

 

I would like the query not to fail when I try to expand the fields, and to have an empty table eventually with same X columns.

 

What would be the best practice for writing a more resilient query?

 

Thank you

2 REPLIES 2
pieduke88
Frequent Visitor

hi - how did you end up resolving this? I'm having the same issue

lbendlin
Super User
Super User

@karimm First thing to do is to enable ManualErrorHandling in your Web.Contents() call.  After that you will want to utilize the built in try ... otherwise ...  feature in Power Query.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.