Trying to create a shortcut displaying the weather forecast for a user determined calendar event

I’m trying to create a shortcut which displays the weather forecast for a user determined calendar event over the next five days. I have been able to achieve this for the next calendar event; however, I can’t get it to work for a user selected event.

Generating the calendar event through user input appears straightforward, and I have access to the Dark Sky API with a key, but Dark Sky just doesn’t seem able to supply the forecast - either the results are blank, or else I get a ‘Conversion Error - Text failed because Shortcuts couldn’t convert from Text to Location.’

Thanks in advance for any help!

Martin

As @RosemaryOrchard stated in a similar post:

I would pull the weather in at the same time as the events and when you select an event, you could immediately display the corresponding weather.

I think Awesome Cal and MiCal show the weather within their calendar apps. Although it’s not detailed. Just an idea :grin:

Can you share what you have so far, but with your API key removed and any personal details suitably anonymised?

The best way to advise on this would be to understand what you have.

The fact it works for the next event suggests that it might simply be something about the data being picked out from a user selection.

For example, if what the user selects and what gets passed on is information about a calendar event rather than actually the event itself, that might explain the symptoms you seem to be having.

Thanks for your help, everyone. I shall take a look at all the suggestions.

Here’s what I have so far:

https://www.icloud.com/shortcuts/12aa000476b149bf9778d5cfa8836861

I’m not 100% sure why, but if I use the “event” variable you created (i.e. the calendar event itself, rather than the result of “get details of event”) as a location and then choose the longitude and latitude that way, it seems to work. (Also removed an extra comma in he URL).

Link because I don’t think my explanation above was very helpful:

https://www.icloud.com/shortcuts/79bc6b41dc034985ad521567a36f9249

In the original shortcut, the latitude and longitude are specified as properties of a particular calendar event.

The calendar event they are linked to is the result of the action highlighted here.

BUT that action is getting details from a calendar event and IS NOT outputting a calendar event. If you check the details of the action, you can confirm that It is actually outputting text.

When the shortcut tries to reference the location related text as a calendar event and then tries to extract the location, it fails to produce an event and subsequently to derive a the latitude and longitude.

That’s why the direct event access @Kaitlin applied works where the original does not.

3 Likes

That works a treat! Thanks ever so much for helping me solve the problem @Kaitlin and explaining the error so clearly @sylumer.

1 Like