How to display the number of records in .csv file import in the visualforce page. I am able to import csv file and display the records in VF page, but I don't know how to display the record count in VF page. Can anyone give suggestions.

  • How you display in VF page ?
    Aug 10, 2017 at 11:47
  • @NITHESHK It is possible to show record count on vfpage form csv file
    – Riyaarun
    Aug 10, 2017 at 11:49
  • 1
    If your able to displaying through list in Vf page then you can use {!List.size } to display your list size directly.
    Aug 10, 2017 at 12:07

1 Answer 1


As NITHESH mentioned, the best bet is probably to use the size method.

Based on where the code that processes the CSV is and how you're handling it, you could put the size request in the controller or in the VF page.

In the controller, it would be something like this:

public integer getRecordCount(){
    return publicRecordList.size();

and in the Visualforce page, just reference it with:


Conversely if the list is available in VF and you're just using an apex:repeat to show it, which is a likely possibility, then simply using what NITHESH said in your VF page would be perfect.


Just make sure that where ever you're showing that count, for either method, you have a re-render happening after the file uploads if it's all on the same page, so the size will have the newest value.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .