Adding a new filter to a search in code studio

I’ve tried to and a new filter a cs.search in code studio the line that start /* spw mod…

its doesnt error which is a good start but it doesnt work either! What i want it to do is exclude any records that dont have a value of person_created_by_system which is a relation to another object? So if its a relation rather than comparing it to an empty string do i need to do something like is not null? but how do i do that?

var a = cs.search({

 'base_object_id':'obj_person',

 'selects': \['person_firstname','person_surname_person','person_address_from_any_source_stamped','person_email','person_ID'\],    

 'filters': \[{'field_path':'person_mobile','value':mob,'comparator':'equal_to'},

            {'field_path': 'person_ID','value': page_id,'comparator': 'not_equal_to','logical_operator': 'AND'},

            



            /\*spw mod\*/{'field_path': 'person_created_by_system','value': '','comparator': 'equal_to','logical_operator': 'AND'},

            

            \],

 'return': 'data'

});

I’d say you probably want a different comparator like “is_empty”, yes. Is person_created_by_system a field path or a relation path? They may behave differently. You could also try adding person_created_by_system to your selects, removing the filter, and seeing what values are returned for valid/invalid records

Indeed Looking at https://docs.netcall.com/docs/liberty-create/2025.3/code-studio/code-other/cs-search

the code seems to be

{‘field_path’: ‘person_created_by_system’,‘value’: null,‘comparator’: ‘empty’,‘logical_operator’: ‘AND’},

I also like your suggestion of putting the field you are doing the comparison to in the selects so that you see whats coming back,

I’m not new to coding but havent done any for 10 years plus and have only started having to do code studio stuff in the last few months. So sometimes it can feel a bit overwheming.