Forum Discussion
solarnstorage
8 years agoRegular Visitor
Parameters setting other parameters
Hi, I want to show specific weather data for one city at a time, among a list of different cities, as requested by the user. The data grab works through a URL that has a numerical code for a spec...
- 8 years ago
You must be quite close because haven't you already edited your M code to append the number (which is in the parameter) to the URL?
You then have to add a line before 'Source = ..... ' in the advanced editor of your query which creates a new variable, something like CityNo = if CityParameter = "Webster" then "4954677" else if CityParameter = "Mayer" then "5036896"
You then use CityNo in the URL which gets assigned in the 'Source =' line.
HotChilli
Community Champion
8 years agoShould be possible, I think. Set up the parameter to pick from a list of cities instead of codes (which presumably you are doing at the moment) If you write M code to translate the value of the parameter from the city to a numerical code, then append the code to the URL.