Heartbeat HTTP monitor evaluate a Date JSON response Field

Hi everyone

I need to evaluate a Date field in a JSON response with a heartbeat monitor. it look like there is a date() option using gval, but I can't make it work.

the HTTP response looks like this.

{
  "syncTables" : {
    "version" : "2022-05-05T08:59:59.629"
    }
}

and I need to evaluate that the date in the version field isn't older than 1 day, because then there is a problem with the sync scheduler on the Web service.

I look forward to hear for you.

thanks :slight_smile:

Sorry to hear you've hit a stumbling block here @mktbec .

TBH, this isn't a use case we handle that well at the moment, I don't suspect it's possible since we don't parse that string as a date.

We are looking at multi-step API journeys, as something for our mid to long term roadmap. At the moment our focus is on the synthetics service. Ultimately, I think you'll want the full power of scripting to do these checks right.

For now, the best answer with our current stack would be to do a browser based check and parse the JSON source, though that's very clunky.

Hi Andrew

Thanks for your response!
I appreciate that a lot!

It is possible for us to change the date-string value to a real date value, would that help?

best regards :slight_smile:

Unfortunately the JSON format doesn't actually have its own notion of dates. What people usually do is encode ISO8601 dates into strings, but we don't actually handle that in a special way.

Hi Andrew

okay, thanks for your time and answers