Forum Discussion

girlwonder's avatar
girlwonder
New Member
2 years ago
Solved

Passing slicer selection to REST API call in power query

I have this slicer.

 

I want the end user to select a Currency Code from the slicer and then use that Currency Code in a REST API call in Power Query?

 

How do I add the Currency Code selected in this slicer to the end of this API call?

 

https://api.website.com/v2/exchange-rates?currency= ???

 

 

 

let
       exchange_rates_url = "https://api.website.com/v2/exchange-rates?currency={Currency Code}", //Web Url
   request_limit = "10000", //number represented by a string
   Source = Json.Document(Web.Contents(exchange_rates_url, [Query = [limit = request_limit]])),
    // number represented by a string
    data = Source[data],
    // number represented by a string
    rates = data[rates],
    #"Converted to Table" = Record.ToTable(rates)
in
    #"Converted to Table"

 

 

2 Replies