Hopefully this is what you want, or at least will help get you to where you need to be. Note that the extra index(..., 1...) for local!matchesOnClaimIdAndClaimType isn't required if you have an "is null or empty" rule available to use in the if() towards…