Help setting up a custom activity field based on custom interval fields

Hello,

I added an interval field : lactate value .

I would like to add an activity field : was lactate measured

Ideally it would be computed with a script based on the presence of the lactate value on at least one interval.

Is there a way to reference intervals ? Custom interval fields ?