Man! Custom Connectors can get confusing to implement. I'm wrapped around the wheel and could use your input.
Custom Connector Specifics:
Method: POST
Request:
{ "geocode": { "lon": -76.1760973855, "lat": 43.302601891152 }, "location_id": "", "start_time": "2018-07-01T12:00:00Z", "end_time": "2018-07-01T18:00:00Z", "timestep": 60, "fields": [ { "name": "temp", "units": "C" }, { "name": "feels_like", "units": "C" }, { "name": "dewpoint", "units": "C" }, { "name": "wind_speed", "units": "m/s" }, { "name": "wind_gust", "units": "m/s" }, { "name": "baro_pressure", "units": "kPa" }, { "name": "visibility", "units": "km" }, { "name": "precipitation", "units": "mm/hr" }, { "name": "cloud_cover", "units": "%" }, { "name": "cloud_ceiling", "units": "m" }, { "name": "cloud_base", "units": "m" }, { "name": "humidity", "units": "%" }, { "name": "wind_direction", "units": "degrees" }, { "name": "precipitation_type" }, { "name": "sunrise" }, { "name": "sunset" } ] }
Response:
[ { "lat": 42.30260171891152, "lon": -71.17609710203855, "temp": { "value": 25.56, "units": "C" }, "feels_like": { "value": 25.56, "units": "C" }, "dewpoint": { "value": 20.13, "units": "C" }, "wind_speed": { "value": 0.45, "units": "m/s" }, "wind_gust": { "value": 2.23, "units": "m/s" }, "baro_pressure": { "value": 101.384, "units": "kPa" }, "visibility": { "value": null, "units": "km" }, "precipitation": { "value": 0, "units": "mm/hr" }, "cloud_cover": { "value": null, "units": "%" }, "cloud_ceiling": { "value": null, "units": "m" }, "cloud_base": { "value": null, "units": "m" }, "humidity": { "value": 72, "units": "%" }, "wind_direction": { "value": 275, "units": "degrees" }, "precipitation_type": { "value": "none" }, "sunrise": { "value": "2018-07-01T09:11:52.000Z" }, "sunset": { "value": "2018-07-02T00:25:08.000Z" }, "observation_time": { "value": "2018-07-01T12:00:00.000Z" } }
]
All headers are in place and the Test results look great.
The Problem:
When trying to use the Custom Connector in my app:
ClearCollect( colWeather, APIRequest.WeatherApi( { apikey:"my-key-is-redacted", accept:"application/json", 'Content-Type':"application/json", geocode: { lon: Value(longitude_input.Text), lat: Value(latitude_input.Text) }, location_id: " ", start_time: DateTimeValue(startTime_zulu.Text), end_time: DateTimeValue(endTime_zulu.Text), timestep:60, fields: [ { name: temp, units: F } ] } ) )
I cannot get the fields parameter to be accepted! I've tried every JSON Table syntax possible including:
Leaving the fields table out of the request brings back all results but in Metric units. To get Imperial, I need to specify each field name and unit type.
The errors I'm receiving include:
"Missing column. Your formula is missing a column 'name' with type "Text".
"Invalid argument type. Expecting a table value, but of a different schema."
There are NO OTHER errors in the query except the fields portion.
Can anyone spot what I'm missing?
Thank you!
Solved! Go to Solution.
Hello,
Can you try instead of [{name: "temp", units: "F"}] --> Table({name: "temp", units: "F"})
Hello,
Can you try instead of [{name: "temp", units: "F"}] --> Table({name: "temp", units: "F"})
This is why I love the PowerApps community! Your solution worked great.
Thank you very much 🙂
User | Count |
---|---|
257 | |
108 | |
90 | |
51 | |
44 |