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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Sankzpower
Helper I
Helper I

Custom API call added as column

Hi guys

 

Hope you can help me out. I have got a column with a logger ID for each row. Then added a custom column with API web to retrieve data for each loggerid. Then I simply added another column1 with Column 1 = Json.Document(Web.Contents([Custom])). This works perfectly and its bringing data for each one. Due to the page size limit on API, its only making only one call. I have found the code which works perfectly to retrieve data through multiple pages on a set page number defined for a single statuc ID.

 

 

List.Skip(List.Generate( () => [WebCall=[], Page = 1, Counter=0], // Start Value
   		each List.Count(Record.FieldNames([WebCall]))<0 or [Counter]<10, // Condition under which the next execution will happen
   		each [ WebCall = Json.Document(Web.Contents("https://energycloud.com/api/LoggerData/dailytotals?&channelNumber=1&apiKey=c&pageSize=100&orderby=id&page="&Text.From([Page])&"")), // retrieve results per call
     			Page = [Page]+1,
     			Counter = [Counter]+1// internal counter
] 
) ,1)

 

 

When I added as another custom column for each row to bring in data for each row (ID) for multiple pages using the above code power bi coming up with an error saying "Custom" column record cannot be found. I know I am almost there but its just I dont know where to go after this blocker?

 

List.Skip(List.Generate( () => [WebCall=[], Page = 1, Counter=0], // Start Value
   		each List.Count(Record.FieldNames([WebCall]))<0 or [Counter]<10, // Condition under which the next execution will happen
   		each [ WebCall = Json.Document(Web.Contents([Custom]="&Text.From([Page])&")), // retrieve results per call
     			Page = [Page]+1,
     			Counter = [Counter]+1// internal counter
] 
) ,1)

 

 

 

Expression.Error: The field 'Custom' of the record wasn't found.
Details:
WebCall=
Page=1
Counter=0

 

 

Any help would be greatly appreciated!

Thanks in advance.

6 REPLIES 6
mariopavic
Frequent Visitor

Are you sure that "Custom" column exists? Also, why do you have "=" after "[Custom]" in your code?

@mariopavic  Yes, the custom column exists as below. The custom column contains the API web address as https://energycloud.com/api/LoggerData/dailytotals?&channelNumber=1&apiKey=cb&pageSize=100&orderby=i...

 

The equal symbol equals to page number

 

Capture.JPG

[Custom]&"="&Text.From([Page])

Try this

@mariopavic  thanks again. However, its coming with error 'Custom' column cannot be found. 

No problem. Can you just take a screenshot of the whole table you're using?

The whole table is literally same as the first two rows with different ids. The issue is that I have created this custom column however not sure how to add this in custom1 column field as power bi does not recognise custom as a record.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors