Forum Discussion
EvanMartinez
8 years agoModerator
HI Chad,
If you are looking to run an API call to return a count of records that meet a specific criteria, for example if you are looking only for records that have a value in their related parent field or that have a number of child records summarized up you would most likely want to use API_DoQueryCount.
Lets say you were looking at a table that lists your Companies and you want to only show the number of Companies that have a contact. You would summarize up the number of Contacts related to each company and set up your query to only return the number of records where that summary field is great then 1. Alternatively, you could do the same by saying in your child table of Contacts only return a count of the Contact records that have a value in Related Company. You can find the basics of API_DoQueryCount on our API Guide:
https://help.quickbase.com/api-guide/index.html#do_query_count.html
Is this the sort of functionality you were looking for Chad? I hope this information was helpful.
If you are looking to run an API call to return a count of records that meet a specific criteria, for example if you are looking only for records that have a value in their related parent field or that have a number of child records summarized up you would most likely want to use API_DoQueryCount.
Lets say you were looking at a table that lists your Companies and you want to only show the number of Companies that have a contact. You would summarize up the number of Contacts related to each company and set up your query to only return the number of records where that summary field is great then 1. Alternatively, you could do the same by saying in your child table of Contacts only return a count of the Contact records that have a value in Related Company. You can find the basics of API_DoQueryCount on our API Guide:
https://help.quickbase.com/api-guide/index.html#do_query_count.html
Is this the sort of functionality you were looking for Chad? I hope this information was helpful.
ChadBrandmire
8 years agoQrew Assistant Captain
kind of.
How would you use DoQueryCount to return only the count of child records related to a parent record?
example:
Parent Record 1 has 5 child records
Parent Record 2 has 7 child records
etc.
How would you use DoQueryCount to return only the count of child records related to a parent record?
example:
Parent Record 1 has 5 child records
Parent Record 2 has 7 child records
etc.