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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kafreitass
Helper I
Helper I

API query

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

1 REPLY 1
v-jayw-msft
Community Support
Community Support

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.