Forums

Records count

devalex 02 Jun, 2018
Hello.I need to display count of records at the bottom of а table. I do not understand how. Please help.
Max_admin 08 Jun, 2018
Answer
Hi devalex,

Just use a different "Read data" action with "Select type" set to "count" and call it under the list!

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
devalex 08 Jun, 2018
thanks Max!
  what can duplicate "read data" I did not think
(i am sorry for my google translate🙂)
amheng5 26 Feb, 2019
Sorry, not sure where to place your reference "call it under the list!"

My current settings to show my total records.

I have created under functions tab:

Read data --> count_records
select "Return the count of records matching the filtering conditions"

Under Views Tab --> created a Table called "total_count"
Data Provider: {var:count_records}
remaining blocks empty

Under Events Tab --
added "Total Records: {view:total_count}" to my index page before the {fn:read_records}

But no count appears. Where am I going wrong?
amheng5 26 Feb, 2019
Here's my solution and setup.

FUNCTIONS TAB
Read Data: count_records
Model - database table
where conditions: left blank

Data Settings: "Return the count of records matching the filtering conditions.

Remaining fields default settings.

VIEWS TAB:
create HTML
named: show_count
Content: <p>The total number of current records: {var:count_records}</p>

EVENTS TAB
index -->
add after model.table
{fn:count_records}
{view:show_count}

Hope this helps someone. I'm finding the answers provided by administrators are vague and really no good samples to follow for CC6 non programmers/users.
healyhatman 26 Feb, 2019
You could just use {var.count:read_data_name} instead of making another read data action. Although it will just count the number returned by the read data and not the number of records matching total (if you're using paging)
murilolule 23 Jul, 2019
Hello everyone!
I have the same problem and I'm not a good programmer, but Chronoforms has solved my problems a lot.

I have a table with various inscriptions for various courses. I would like to limit the number of places per course.

I know that by pressing the submit button I will have to read the number of records of the completed course. How do I do that???

Help me please!
healyhatman 23 Jul, 2019
In your submit even, use a read data action set to retire the count of records. Then use an If Conditions action and if the number of records is equal to the maximum number, display an error message and use an event load action to go back to load.
murilolule 24 Jul, 2019
healyhatmanhealyhatman, thanks for the attention. I just have to thank you in advance!

Like I said, I'm not a good programmer and I'm still abusing myself with chronoforms6.

I don't know where to put the "If Conditions action". Do I put it in "Read Data" (found or not found?) Or outside "Read Data"?

The link of the form: https://www.educatu.com.br/index.php?option=com_chronoforms6&chronoform=replanejamento
The link of my form backup: https://drive.google.com/open?id=1PsswKztK1o8IC8XQOc7YEbhdC8eWt6CD

Thank you for helping me!!!
murilolule 24 Jul, 2019
healyhatman, hello again.
Thank you for your patience with me.

I understand the process, but I don't know how to configure each component.

Should I put any "where conditions" in the "read data"?

How should I bring the records read in "read data" to if conditions "?
I don't know how to set this up!
 
(I'm trying to attach images, but there is an error uploading)
murilolule 24 Jul, 2019
I forget to tell: i´m using Chronoforms 6.1
murilolule 24 Jul, 2019
https://drive.google.com/open?id=1KrsjADz4gnU8L2vsISQjDWW1MVvac0Zc
healyhatman 24 Jul, 2019
You should use where conditions if you need to get only some entries.

Bring the value to if conditions with {var:readdataname}
murilolule 28 Jul, 2019
Hello again.
I could not do the process.
In fact, I have to display a form with 20 courses. Each course has a different limit of places.

When the course appears, in the submit event, I need to count vacancies (I got it).
What I can't do is call the process of writing data into "if conditions" in this situation.
Can you give me an example, please?

How do I compare the course offered and the number of places and do the respective processes?
murilolule 29 Jul, 2019
I forgot to say tha i´m doind this in chronoforms.
healyhatman 29 Jul, 2019
You didn't forget, you said it a bunch of times.

Where are you getting the limits from? Have you stored the limits in the database somewhere?
murilolule 30 Jul, 2019
I have this in a "vacancies" table, but it could also put in some component configuration.
What I do not understand how to do is how to bring this into the "if conditions" and query / compare with the number of workshops already counted in the "read data", and after that, generate a form action.
murilolule 30 Jul, 2019
look here: https://drive.google.com/open?id=1avhq8p4lLJHp2xyJigkjnQkuLzG9CoYd
This topic is locked and no more replies can be posted.