Forum Discussion
luckygirl
Helper I
1 year agoWeb.Contents Query parameter - multiple filed values for one parameter
Hi I am trying to specify multiple filed values for one parameter. I had a look at a similar post. https://community.fabric.microsoft.com/t5/Desktop/Web-Contents-Query-parameter-multiple-paramet...
- 1 year ago
The below code worked for me.
= let // List of subjects subjects = { "TEST1", "TEST2" }, // Function to fetch data for a single subject getDataForSubject = (subject as text) => let queryParams = [ #"per_page" = "100", #"and[display_collection][]" = "test", #"sort" = "date", #"direction" = "desc", #"and[subject][]" = subject, #"APIToken" = "123" ], source = Json.Document(Web.Contents("http://api.test.org/v1/records.json?", [Query = queryParams])) in source, subjectQuery = List.Transform(subjects, each getDataForSubject(_)) in subjectQuery
v-saisrao-msft
Community Support
1 year agoHi luckygirl,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
luckygirl
Helper I
1 year agoThe below code worked for me.
= let
// List of subjects
subjects = {
"TEST1",
"TEST2"
},
// Function to fetch data for a single subject
getDataForSubject = (subject as text) =>
let
queryParams = [
#"per_page" = "100",
#"and[display_collection][]" = "test",
#"sort" = "date",
#"direction" = "desc",
#"and[subject][]" = subject,
#"APIToken" = "123"
],
source = Json.Document(Web.Contents("http://api.test.org/v1/records.json?", [Query = queryParams]))
in
source,
subjectQuery = List.Transform(subjects, each getDataForSubject(_))
in
subjectQuery- lbendlin1 year ago
Super User
you should not include the question mark in the URL.