I am using the Google Calendar Get All Node. I am searching to see if a calendar event has been made in Google. If it was, I want to edit the details. If no event was found, I want to create a new event.
Here is how I have my Google Calender node set up. I think I have it working, at least when I try to test it, it seems like it works.
Here is where I am not sure how to set up my IF node. I am hoping someone can help me with this issue. I have searched google, the community and even asked ChatGPT but so far nothing is working.
So it seems like more testing, the Google Calendar node has changed. From other topics on it, there used to be fields you could insert search criteria into. Now the “query” field seems like it only searches the description field in Google Calendar. If only finds my event if I put all the stuff in there. It doesn’t actually look at the event date or event title fields.
Does anyone know if this has changed? Or how I can search these other fields to find my event.
@jlhsolutions , in the settings of the node where you check the events enable “Always Output Data”. Then in IF node you can check if any item exists.
@ihortom Ok I enabled that setting, but I think my Google Calendar Node isn’t working properly because it’s not finding events that it should be seeing.
I have been trying to figure out why it’s not seeing it, but I think it’s only searching the description field, not the title, date, etc. I can’t seem to find anything that talks about how to change this.
Ok, it seems like part of the issue is time. The event is listed in EDT, but my calendar is PDT. So now I need to convert the time. I have tried multiple variations of the code in the code node to convert time, but nothing is working.
I keep making strides in this but I also keep hitting road blocks.
@jlhsolutions , I would remove the date from the Query box (leave just the name). The node offers to use the Date in the Options instead. You have “After” and “Before” in your disposal.
Yes, I have been playing with the After and Before Settings today. I think the issue is the time of the event is listed as EDT, but it’s shown as PDT because I live in a different time zone. So I need a way to convert this but I can’t seem to find code that works. I have had ChatGPT write many many different versions, but all of them error out as its trying to use moment-timezone or Moment.js and as I’m using the cloud version for now, I don’t have these libraries.
I even tried creating a code node that would convert it but I haven’t been successful with that either.
If I move the event 3 hours in the future, it will find it, but then its at the wrong time, so that doesn’t help me because the event is saved for the wrong time.
@jlhsolutions , the problem is you are using string representation of the date rather than the date value. Switch to Luxon object DateTime and specify the timezone you need. For example, {{ DateTime.fromSQL($json.body.event_start_date_time).setZone('America/New_York') }}.
As your incoming start_time and end_time come without the time zone values, it is considered to be local to your workflow (your workflow time zone). Any usage of setZone() will be adjusted from there.
When I change it to Los_Angeles, it is the same time it was at, but its still 3 hours into the future.
Makes sense, as the difference between New York and Los Angeles is 3 hours.