Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
I have this code and i need to to pagination because i am blocked in 4000 rows
Thanks
let
Source = Json.Document(Web.Contents("https://aaa.com/e/b786781647146174618/api/v1/xxxx/yyyyy/hosts?tttt=true", [Headers=[Accept="application/json; charset=utf-8", Authorization="xxxx"]])),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"entityId", "displayName", "discoveredName", "firstSeenTimestamp", "lastSeenTimestamp", "tags", "fromRelationships", "toRelationships", "osType", "osArchitecture", "osVersion", "hypervisorType", "ipAddresses", "bitness", "cpuCores", "logicalCpuCores", "monitoringMode", "networkZoneId", "agentVersion", "consumedHostUnits", "userLevel", "autoInjection", "managementZones", "hostGroup"}, {"Column1.entityId", "Column1.displayName", "Column1.discoveredName", "Column1.firstSeenTimestamp", "Column1.lastSeenTimestamp", "Column1.tags", "Column1.fromRelationships", "Column1.toRelationships", "Column1.osType", "Column1.osArchitecture", "Column1.osVersion", "Column1.hypervisorType", "Column1.ipAddresses", "Column1.bitness", "Column1.cpuCores", "Column1.logicalCpuCores", "Column1.monitoringMode", "Column1.networkZoneId", "Column1.agentVersion", "Column1.consumedHostUnits", "Column1.userLevel", "Column1.autoInjection", "Column1.managementZones", "Column1.hostGroup"}),
#"Expanded Column1.hostGroup" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1.hostGroup", {"meId", "name"}, {"Column1.hostGroup.meId", "Column1.hostGroup.name"}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Expanded Column1.hostGroup", "Column1.hostGroup.name", Splitter.SplitTextByDelimiter("--", QuoteStyle.Csv), {"Column1.hostGroup.name.1", "Column1.hostGroup.name.2", "Column1.hostGroup.name.3"}),
#"Added Custom" = Table.AddColumn(#"Split Column by Delimiter", "ID_fromHG", each try Number.FromText([Column1.hostGroup.name.1]) otherwise null),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "source_env", each "STG")
in
#"Added Custom1"
Thanks for help
Hi @Zied_IT90 ,
You can take a look at the following document about the help functions about processing pagination API if it meets your requirement:
Helper functions for M extensions for Power Query connectors - Power Query | Microsoft Learn
This is the related document, you can view this content:
Solved: Pagination of a REST API in Power Query using M - Microsoft Power BI Community
Solved: REST API Paging Power Query - Microsoft Power BI Community
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Liu,
I tried to copy this code but in ToTable i find this problem :
Expression.Error: We cannot convert a value of type List to type Record.
= Record.ToTable(Source)
Details:
Value=[List]
Type=[Type]
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 46 | |
| 32 | |
| 29 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 60 | |
| 57 | |
| 38 | |
| 23 | |
| 21 |