Xml-rpc: fetch records having valid values in Username field

I am looking for contacts who have Username & password fields populated with some value.
As I have gone via discussion I have to use xml-rpc only to get username and password in response (REST API does not support it).

How would I fetch only those records which have value in them using XML-RPC?
Fetching all contacts and then filtering would not be an efficient solution. Could that be done at query level?

Use the data object method query and key on the username or password fields. If you’re just looking for all that have those fields set, then check for the wildcard value as in “password”=>“%”

I do a query with username=> “%” but it is returning me the records which have username field absent in it.

If I use username => “%Hima%”, it does return records where username as Hima in it.

You know what? That does make sense as that wildcard means everything. Sorry…try using the underscore wildcard.

You mean:
Username => “%_%”
??

Becuase Username > “_” returns me nothing

It may be that field doesn’t map the same. I know it works on other fields like names and id’s

So here’s an idea. Create a saved search in IS using the ‘contains’ and underscore for a query on the user name field and then pull the saved search data with the xml-rpc search object. The report works to pull only those with a username and using the search object will give you realtime results.

Few questions:

  1. Do you mean I create a search filter with contains and _ character in text?
    See below screen shot

Screenshot%20from%202018-03-28%2015-05-00

  1. ID’s - Where can I locate the saved search id & my id (creator of saved search)

I think I am very close to get a resolution , thanks for your help till now.

Sorry about delayed response…had a family matter this week. So yes, if you create a saved search then you can pull the results with the api.

Hi John,

Could you help with my above two queries??
I am unable to query using solution suggested by @John_Borelli

@Himanshu_Phirke,

Once you create a saved search with the parameters you need, you can then pull that information with the XML-RPC using the Search object:

https://developer.infusionsoft.com/docs/xml-rpc/#search-retrieve-a-complete-report-from-a-saved-search