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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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