Hi
Could you let me know if I\'m missing a simple solution, or do I need to write a custom shortcode?
I created a form with 3 Date fields. Each field represents the date of a milestone in a project.
For example:
Field 1 title: Milestone 1
Field 1 content: 01 Jan 2023
Field 2 title: Milestone 2
Field 2 content: 01 Feb 2023
Field 3 title: Milestone 3
Field 3 content: 01 Mar 2023
I want to create a view for the above form that displays the next milestone date.
If a user looked at the view today, they would see: Milestone 1 - 01 Jan 2023
If a user looked at the view after 01 Jan 2023, they see: Milestone 2 - 01 Feb 2023
If a user looked at the view after 01 Feb 2023, they see: Milestone 3 - 01 Mar 2023
I have tried to achieve the above using conditional statements in a view; for example:
[if x greater_than_or_equal_to=\"10\"]Add content here[/if x]
However, conditional statements require a string, and I need to use a shortcode, for example:
[if x greater_than_or_equal_to=\"[161]\"] which does not work. I have also tried to use the frm-condition shortcode however its conditions are too basic (equals, not_equal, greater_than, less_than, like), and it does not allow multiple conditions.
I\'m looking for something like this:
I know it\'s easy to sort entries, but I want to sort fields in an entry! Am I pushing formidable forms too far, or is there an easy solution I am overlooking?
Any guidance is appreciated
Thanks
John
Thank you for your suggestion Bobby
Filtering is used to display a filtered set of entry records.
I don't think it can be used to show certain field values within an entry.
Got ya. With the conditional statements, try to compare the output of your 2 date fields and make sure they match up. Maybe place them outside of if statements. You might need to add format to the field id shortcode:
[x format="m/d/Y"]
<p><p>Conditionals require a string, for example:[if 191 less_than_or_equal_to="2023-01-11"] Display date [191][/if 191]</p><p>This will work.</p><p>However, what I need is something like this:</p><p>[if 191 less_than_or_equal_to="[191]"] Display date [/if 191]</p><p>If I use a string it means a I have to make a new view for every entry.</p><p> </p></p>
The less_than_or_equal_to="[191]"] should be populating as 2023-01-11 (191 that is) if that is a value for the entry you are working with and it has the proper formatting defined.
Hi Bobby
You can't use a shortcode in a conditional statement (I think). For example, the shortcode below is [192]:
[if 191 less_than_or_equal_to="[192]"] Show content [/if 191]
It is not mentioned anywhere here: https://formidableforms.com/knowledgebase/conditionals/
You can only use a string:
[if 191 less_than_or_equal_to="8 November 2022"] Show content [/if 233]
I hope I am overlooking something here.
Thanks
John
At this point you will have to write custom code. You should however reach out to the Formidable team and inquire why "than_or_equal" isn't available in the "frm-condition" shortcode. Additionally, most of the other shortcode that works with these queries allow you to use each parameter type once (example: less_than_or_equal, but also greater_than_or_equal in the same statement, but not less_than_or_equal and then less_than_or_equal again in the same statement). They should provide some clarity on that and ideally update code across the table for consistency. That's not my call though.
I will follow up with the Formidable team about this.
Thank you, Bobby, for your help.
I appreciate it.
Sure thing. Glad to try and help where I can. Take care.
Please login or Register to submit your answer