Since I didn't add it before, this is an example of an expression that works, but it has the key I need hard coded I just need to find a way to dynamically get that key from my valcode table instead of having to hard code it
jsonPath($, "persons.old[*].names[*].type.detail.id").indexOf(jsonPath($, "valcodes['person-name-types'][*]").filter((value)=>value.code=='LEGAL')[0].id) != -1 ?jsonPath($, "persons.new.names[0].firstName") != jsonPath($, "persons.old[*].names[?(value.type.detail.id == '55110e25-2ec5-421f-82d5-cc98451a019e')].firstName").toString(): false