Can I update a variable value during an async API ...
# 🤝help
I created a code block to query some information from API, and i used an async function and updated the value of a workflow variable in side the async function. and tried to print out the vairbale rigth afterwards but find that vairable to be empty, while in the log i can see that variable was assigned a value. do you know why that is the case? the line of my code is: workflow.weatherDescription = weatherDescription; Below is my code: const lat = '43.49' const lon = '-80.53' const apiKey = 'df715295314c6e564a351abf1dc73787' const url =${lat}&longitude=${lon}¤t_weather=true&hourly=weathercode
async function fetchData(url) { const response = await axios.get(url) const weatherData = console.log('---->weather', JSON.stringify(weatherData, null, 2)); const weatherCode = weatherData.weathercode const weatherDescription = weatherCode; workflow.weatherDescription = weatherDescription; console.log('---->session weather description', workflow.weatherDescription); // return weatherData } console.log(fetchData(url));