try { // Use an External API to fetch the current weather for New York City (latitude: 40.7128, longitude: -74.0060) const data = await window.fetch(`https://api.open-meteo.com/v1/forecast?latitude=40.7128&longitude=-74.0060¤t_weather=true`).json(); const currentFahrenheitTemperature = Math.round((data.current_weather.temperature * 9/5) + 32); // Set the fetched temperature as a field value in the form broadhead.sendAction('set-value', { fieldId: 257193, value: currentFahrenheitTemperature }); } catch (error) { console.error("Error fetching weather data:", error); }