We are trying to create a mental health referral system that is accessed by school district administrators, school site personnel and mental health service providers. We want all of the data collected to reside in a single table and filter the data views by District, School Site, Therapist and/or UserID.
I used Pods to add meta fields to the User profile. I am filtering the table views using (for instance) "District is equal to [user_meta key=user_district]." It works perfectly. I want to filter the data used to generate charts in the same way.
Is there a way to filter chart data with User meta fields?
Look here to start -> https://formidableforms.com/knowledgebase/graphs/#kb-filtering-parameters
This is a list of parameters that the charts take as is.
Thanks, Bobby. I studied the parameters provided by that link to begin my quest. I didn't see a way to filter chart data using custom user meta fields. Did I miss something?
I didn't see any reference to charts, but could the code snippet suggested in this tutorial solve the problem?
https://connect.formidableforms.com/user-tutorials/display-content-based-on-user-meta-value/
Good point. So you want to show data specific to a user with a particular meta field value then or are these graphs to be visible to the currently logged in user with a particular meta field value?
We want to show data specific to a user with a particular meta field value.
For instance, we want to limit the graph data to records where the "District" form field matches the user meta field "user_district". We do not want a school site person to see data (table or chart) across an entire district. For school site personnel, we would display chart data where the "School Site" form field is equal to the user meta field user_school_site.
You can probably do this with ChartJS. It's a lot more flexible than using Google Charts as Formidable does. https://www.chartjs.org/
Thanks, Victor. I'll give it a whirl!
I'm pretty sure I figured it out. It seems to be as easy as:
[frm-graph fields="xxx" type="column" data_type="count"][user_meta key=user_school_site][/frm-graph]
[frm-graph fields="xxx" type="column" data_type="count"][user_meta key=user_district][/frm-graph]
It would be nice to automagically inherit a view filter by clicking a box but this isn't too cumbersome.
Um. Never mind. It does NOT seem to be working. Ugh!
If it's a new form, you can save the meta value in a hidden field and filter that field.
Thanks, Shawn. I am saving the meta value in a hidden field within the form but I can't see how that allows me to filter a chart. I have no problems filtering data views using the custom user meta fields. I just can't find a way to apply a custom user meta field to filter a chart.
Please login or Register to submit your answer