Change request url for Vattenfall API automatically every day

  1. Put a function node before the HTTP Request node containing...

    const today = new Date()
    const tomorrow = new Date(today)
    tomorrow.setDate(tomorrow.getDate() + 1)
    const yyyy = tomorrow.getFullYear();
    const mm = (tomorrow.getMonth() + 1).toString().padStart(2, "0");
    const dd = tomorrow.getDate().toString().padStart(2,"0");
    msg.url = `https://www.vattenfall.se/api/price/spot/pricearea/${yyyy}-${mm}-${dd}/${yyyy}-${mm}-${dd}/SN3`
    return msg;
    
  2. Clear the http request node URL property so that is uses msg.url from the function