Building where clause for definedProps