PyPardot4 icon indicating copy to clipboard operation
PyPardot4 copied to clipboard

Query a subset of fields from a table

Open tian-l-park opened this issue 6 years ago • 4 comments

Hey, I am trying to use p.prospects.query(fields=[a_list_of_field_names]) to pull only a subset of fields from the prospects table. However, the method only returns 2 columns no matter how long my list is. The returned columns will always be id and whatever field that is the last element in the list. Am I not passing the parameters correctly? Thank you!

tian-l-park avatar Mar 04 '19 23:03 tian-l-park

Hi @tian-l-park , I think you are misunderstanding the query function and confusing it with one of the read functions.

p.prospects.query will run a query to get a list of prospects matching your query criteria. You can then use the ids returned with p.prospects.read_by_id(id=id) to get the full information of a particular prospect.

mneedham91 avatar Mar 07 '19 14:03 mneedham91

Hey @mneedham91 , thank you for your response!

Do you know if there is anyway I can query only a subset of fields? I have a big table with 100+ columns and I noticed it takes more than 6s to complete a call. I am thinking maybe by pulling a select number of fields it will run faster. Do you know if there is a function to do that?

Thank you!

tian-l-park avatar Mar 13 '19 00:03 tian-l-park

The Pardot API itself doesn't allow query filtering on arbitrary fields. We get ID ranging and date, scores and grades filtering only.

creuzerm avatar Jan 20 '20 16:01 creuzerm

Is it possible to provide a feature that supports fields query either that contains None or with values?

zhar97 avatar Jun 25 '20 14:06 zhar97