Weekly entries total/average values ( frm-stats)

By: Adrian Gurbina | Asked: 05/26/2023
ForumsCategory: How-toWeekly entries total/average values ( frm-stats)
Adrian Gurbina asked 11 months ago
Hello, I have a form in which i'm collecting every day some values and i would like to generate a table with the weekly average and total. I tried using wpdatatable to use the frm-stats shortcode with the parameters from a search form related to user_id to do a weekly report but i end up with an issues that the frm stats is not processed in the shortcode cell ( value is 0). If i run the same shortcode on page is providing the proper value. There is any possibility with Formidable form to run a "script" every week and generate a entry into a form with the average value for that particular week for every user which provides the data in entries? Best regards, ADrian 
Victor Font replied 11 months ago

Are you using a view or just WPDataTables? With a view, you create it once and your table should generate automatically every time to display it.

Adrian Gurbina replied 11 months ago

i used view and WPDataTable in a view and stand-alone in a page. To show the current weekly average is ok. What i would like to display is the previous week number average values till current week number( there is a wordpress plugin which provides a shortcode for that). Also i want to display these based on a form which will filter the user id ( user report data sheet concept).
I'm trying to figure out a way in FF view if i can for a foreach value of week number ( 1 to currentweek ) to do a listing of the average. That is the tricky part. I wanted to do in WPDataTable but i noticed that the frm-stats is not running in cell if i add it as a shortcode if i run a URL filter based on frm_user_id.

1 Answers
Victor Font answered 11 months ago
Formidable has a foreach shortcode already that is used for repeaters and multi-select fields. Your requirement can be met, but you'll need to create your own shortcode to generate the entire table's output. The shortcode logic would contain all of code that would meet your requirement, run the SQL or frmstats methods required, and generate the output to show in the view. All this work is PHP. I really can't tell you how to do this, because the how to do it is custom to your particular design.
Victor Font replied 11 months ago

Formidable Masterminds uses many custom shortcodes that I've written. With a custom shortcode, if you know what your doing, you can manipulate view displays to show anything you want. Here are some examples that I just released as part of the code for Codex V2:

About Codex V2

Read down the first few paragraphs until you come to the list items of Formidable add-ons without WordPress hooks. This is an example of a custom shortcode extracting Formidable Form data from a dynamic lookup table in real time.

Here's another example: Codex V2 Filter List

The output below the search form is a triple-nested Formidable Visual View. The 3rd-level view's output is a single shortcode with parameters. The parameters allow the single set of views to work across both action and filter entries.

Adrian Gurbina replied 11 months ago

Much appreciated Victor.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community