Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Experts,
Power BI data is getting from api link. I have difficulty to connect using token authenticaton . Following is my code. What i am doing wrong here. please advise.
let
test = {username : Lordloc , password : ******},
AccessTokenHeader = "test" & "Bearer *" ,
Headers = [Authorization = AccessTokenHeader],
url = "https://dfsf.cdsfe.ae:3289/dede/getCusfedfsfock",
body = "{ ""plant"" : ""c051"",
""storageLocation"" : ""0001"",
""type"" : ""MARD"",
""sapid"": ""qEP""
}",
Source = Json.Document(Web.Contents(url,[
Headers = [#"Content-Type"="application/json"],
Content=Text.ToBinary(body)
])),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"plant", "material", "storageLocation", "warehouseNo", "quant", "storageType", "unrestrictedStock", "stockInTfr", "qualityInsp", "restrictedUse", "blocked", "returns", "totalQuantity", "availableStock"}, {"Column1.plant", "Column1.material", "Column1.storageLocation", "Column1.warehouseNo", "Column1.quant", "Column1.storageType", "Column1.unrestrictedStock", "Column1.stockInTfr", "Column1.qualityInsp", "Column1.restrictedUse", "Column1.blocked", "Column1.returns", "Column1.totalQuantity", "Column1.availableStock"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"Column1.material", "material"}, {"Column1.plant", "plant"}, {"Column1.unrestrictedStock", "unrestrictedStock"}})
in
#"Renamed Columns"
teste
Hi @avictoria ,
Does any error message appear? I can't reproduce your error scenario here.
For now, you may check the following link for reference.
Solved: How to configure Power BI REST API as a data sourc... - Microsoft Power BI Community
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Friends your input is much appreciated.