mneedham91/PyPardot4

Query a subset of fields from a table

Opened this issue · 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!

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.

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!

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

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