Cannot filter the entries by retrieving the value from the URL using a parameter.

By: John Lenehan | Asked: 01/25/2024
ForumsCategory: General questionsCannot filter the entries by retrieving the value from the URL using a parameter.
John Lenehan asked 11 months ago
Hi   When I insert a graph on a page using this shortcode: [frm-graph fields="30" type="column" data_type="count" 55=821] Everything works as expected.   However, when I try to filter the graph using this URL and query string as shown here: https://feedback.hiberniacollege.com/tutorial-feedback/?eventid=821 And this shortcode: [frm-graph fields="30" type="column" data_type="count" 55=[get param='eventid']] I get this error message: "You must include a field id or key in your graph shortcode.]"

It looks like the shortcode is broken.
I am following the documentation correctly:
https://formidableforms.com/knowledgebase/graphs/#kb-get-param

Has anyone else had this issue? Thanks John            
1 Answers
Victor Font answered 11 months ago
I've never seen [get param] not work unless there's an underlying cause in the technical architecture. When I answer a post like this, the first thing I look for is a misunderstanding of the documentation. No, that's not this. You've configured the shortcode correctly, so that means there's something else wrong that we can't determine from the shortcode. I'm going to continue my response in the comment below.
Victor Font replied 11 months ago

First, I'm certain you've setup your shortcode parameters. I'm questioning the 821 value in your shortcode. I think what might be happening is related to this value. But as a double check, please answer a few questions:

30 is the ID of the field you are charting. You want to display a bar chart for a simple count of field 30 that match your filter field 55 for value 821. That's how I read your shortcode's logic. You want to display a single column bar chart. Is that correct?

So, now we zero in on the filter. Let's forget [get param] for a moment. I don't think [get param] is a problem. I think there's a mismatch between 55 and 821, meaning 821 is not the value stored in the database. So here are some questions:

Where does 821 come from? This looks like a dynamic field's value. Is 55 a dynamic field? What's its data source?

What type of field is 55? Is it a dynamic, lookup, dropdown, or something else?

If dynamic or lookup, do you know the difference? Knowing the difference changes how parameters are passed. Please see this Formidable Knowledgebase article for details: https://formidableforms.com/knowledgebase/dynamic-vs-lookup-fields/

There's another way to do this, that may be easier than shortcodes. I don't know for sure because I haven't played with the feature yet. As far as I know, it's relatively new. The video just came out and it's definitely worth watching, especially if you've graduated into block theme development. It's Formidable's graph block. If you have not seen this feature yet, please watch this. I was blown away when I saw it!

https://youtu.be/p6k8_Bv6mFM?si=Yz_jbFIl3ExPGPgU

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
crossarrow-right