Forum Discussion
Breticious
Helper I
8 years agoPassing Variables in API Post Request JSON Body
I am looking to make a semi-flexible template where the user punches in their own personal credentials into the JSON body being passed into my GET. I want to replace the [username parameter] and [pas...
- 8 years ago
Ok. I figured it out. I had to use an annoying text combination:
let LOGIN = Text.Combine({"""",Login_Parameter,""""},""), PW = Text.Combine({"""",Login_Password,""""},""), body = "{ ""UserName"":"&LOGIN&", ""Password"":"&PW&" }",Just to reiterate, the parameters I setup are named Login_Parameter and Login_Password and formatted as Text. The result comes out as:
body = { "UserName":"breticious", "Password":"password123" }
Breticious
Helper I
8 years agoOk. I figured it out. I had to use an annoying text combination:
let
LOGIN = Text.Combine({"""",Login_Parameter,""""},""),
PW = Text.Combine({"""",Login_Password,""""},""),
body = "{
""UserName"":"&LOGIN&",
""Password"":"&PW&"
}",Just to reiterate, the parameters I setup are named Login_Parameter and Login_Password and formatted as Text. The result comes out as:
body = {
"UserName":"breticious",
"Password":"password123"
}Terry2023
3 years agoFrequent Visitor
can this be used to resolve the following substitution for parameters?
let
dateRangeStart=dateRangeStart,
dateRangeEnd=dateRangeEnd,
body = "{ ""dateRangeStart"": ""2022-01-01T00:00:00.000"", ""dateRangeEnd"": ""2022-12-01T23:59:59.000"", ""detailedFilter"": { ""page"": ""1"", ""pageSize"": ""500"" } }", Source = Json.Document