Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello All,
I have a table of identifiers using a rest API call. The table looks like this:
| identifier | URL | datecreated | authorizeddate |
| a7f8sy9hh7g8ft55 | https://api.neogov.com/rest/personnelactions/hire/a7f8sy9hh7g8ft55 | 2023-02-15T10:25:14.0270000 | 2023-02-15T10:25:14.0270000 |
| sjgg839hkwjr0fkt | https://api.neogov.com/rest/personnelactions/hire/sjgg839hkwjr0fkt | 2023-02-15T10:25:14.0270000 | 2023-02-15T10:25:14.0270000 |
I am adding a custom column that calls another api that reads the identifier and returns the api information. Here is the code I use for the custom column.
let
Source= Json.Document(Web.Contents("https://api.neogov.com/rest/personnelactions/hire/" & [ID], [Headers=[#"Content-Type" = "application/json",#"Authorization"= "Basic Token"]])),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
It errors for all rows saying a record can not be converted to list. Any help would be appreciated.
Solved! Go to Solution.
I removed a conversion to table and just clalled the records then expanded the record. Here was teh code that worked:
let
Source= Json.Document(Web.Contents("https://api.neogov.com/rest/personnelactions/hire/" & [ID], [Headers=[#"Content-Type" = "application/json",#"Authorization"= "Basic Token"]]))
in
source
I removed a conversion to table and just clalled the records then expanded the record. Here was teh code that worked:
let
Source= Json.Document(Web.Contents("https://api.neogov.com/rest/personnelactions/hire/" & [ID], [Headers=[#"Content-Type" = "application/json",#"Authorization"= "Basic Token"]]))
in
source
Please read the Web.Contents documentation again (especially the RelativePath section). Also make sure that your API call returns data and not an error message.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
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 |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |