Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey guys!
Could someone help me?
I'm trying to extract data from a platform through API to bring me, for example, the products table. I built the code below, however, it only brings me the specific product according to the "pesquisa" parameter.
How could I build this dynamically?
Another doubt is that there is a limit of requests, is there any solution?
let
Source =
Json.Document(
Web.Contents(
"https://api.com.br",
[
RelativePath = "api/custumers.php",
Query =
[
token = "tokentokentokentokentokentokentokentokentokentokentoken",
formato = "json",
pesquisa = "EWD-ME3"
]
]
)
),
retorno = Source[retorno],
produtos = retorno[produtos],
produtos1 = produtos{0},
produto = produtos1[produto],
#"Converted to Table" = Record.ToTable(produto),
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"id", Int64.Type}, {"nome", type text}, {"codigo", type text}, {"preco", Int64.Type}, {"preco_promocional", Int64.Type}, {"unidade", type text}, {"gtin", Int64.Type}, {"tipoVariacao", type text}, {"localizacao", type text}, {"preco_custo", Int64.Type}, {"preco_custo_medio", Int64.Type}, {"situacao", type text}})
in
#"Changed Type"
Thanks
Hi @kafreitass ,
Not very clear. You may take a look at this post.
https://stackoverflow.com/questions/16194034/sending-json-and-using-a-dynamic-data-parameter .
Best Regards,
Jay
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
106 | |
104 | |
81 | |
63 |