In addition to @mwra’s always-authoritative advice, there’s another trick, just in case you (@andreas) are not aware of it or have forgotten about it. It’s the |= operator, the “pipe” symbol followed by the equal sign.
If the action part of your agent says the following:
Then the value for $EndDate will be updated only if it hasn’t already been assigned a value. Otherwise the value remains what is already there. It’s a different way of testing for an empty / default-value / unassigned field (recognizing slight differences among these).
The way I think of the |= operator, which I use all the time, is that it assigns a value where there isn’t one, but it doesn’t mess up any value you have intentionally assigned. aTbRef has the more detailed explanation here.