CSV to html – filter data – userid and name

If you want to filter out data based on userid or username, it’s possible to achieve this using %userid% or %userlogin% within the filter_data attribute. NOTE! If you’re using user-based sorting (sort_cols_userclick set to yes) or if you have search functionality on, then this filter will dissapear and show all rows based on the search (because the search functionality is based on the filter functionality).

Original

SR.NAMEGENDERAGEDATE COUNTRY
1Dett2Female3616/08/2020Great Britain
2Nern Female1915/10/2017France
3KallsieMale2016/08/2016France
4SiuauFemale2121/05/2015Great Britain
5ShenniceMale2221/05/2016France
6ChasseFemale2315/10/2018France
7TommyeMale2416/08/2017United States
8DorcastFemale2521/05/2016United States
9AngeleeMale2621/05/2017Great Britain
10WilloomFemale2615/10/2019France

Filter data

This example below shows data based on userid – if logged in userid is 1.

Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" filter_col="sr." filter_data="%userid%" filter_operator="equals"]
SR.NAMEGENDERAGEDATE COUNTRY
1Dett2Female3616/08/2020Great Britain

This example below shows data below if logged in user is Siuau.

Shortcode
[csvtohtml_create source_type="guess" source_files="free_testdata_10rows.csv" filter_col="name" filter_data="%userid%" filter_operator="equals"]
SR.NAMEGENDERAGEDATE COUNTRY
4SiuauFemale2121/05/2015Great Britain