Hi,
I’m trying to compare one of my field values with the current user’s login or even first name.
I have tried the following comparing the dropdown value equals …
[user_id]
[25 show=first_name]
[current_user]
[login]
[first_name]
etc……
Is there an easier way of getting this value?
Thanks




October 26, 2012 at 4:37 pm
I'm trying the alternative; by coding the where clause in the content area.
[if 327 equals=first_name]
[if 327 equals=[first_name]]
[if 327 equals =[user_id]]
Is there a better way to make this work in the content area?
October 26, 2012 at 5:53 pm
I'm giving your other method or passing parameters instead.
In reference to this topic.. http://formidablepro.com/help-desk/current-logged-in-userid-to-use-in-custom-display/
You create a shortcode that captures the user's id, that then allows you to pass as a parameter. But how would I pass the parameter right after login? eg. After the login, the user get's sent to their dashboard. Which needs the userid parameter to display reports.
Thanks
October 29, 2012 at 10:55 am
Here's a related post about writing a custom shortcode to compare two values like this.
http://formidablepro.com/help-desk/custom-display-if/
I'm not sure what you're asking, or how it would be any different from any other time.
October 29, 2012 at 11:03 am
So, there isn't any shortcode to display the current user for the where clause? Screenshot
Attachment:

October 29, 2012 at 11:09 am
What type of field is "selling Agent", and what value are you saving into it? The dynamic default values will work in that box too.
October 29, 2012 at 11:41 am
On the form, I have a drop down that pulls in "dynamic entries" from another form. The dynamic entries is also their username field on the registration page (using the registration plugin). So it's usually text like "sam".
I tried the dynamic default values, found on the form builder ([login]), and they didn't pull back anything. I always get "No Entries Found". The strange thing is, if I manually put the value in the where clause, it still doesn't show anything.
October 29, 2012 at 12:29 pm
Data from entries fields work differently. You must use the ID or key of the entry. This sounds like it would need custom code to find the ID or the correct entry.
http://formidablepro.com/knowledgebase/frm_where_filter/
add_filter('frm_where_filter', 'filter_custom_display', 10, 2); function filter_custom_display($where, $args){ if($args['where_opt'] == 25){ //change 25 to the ID of your data from entries field global $user_ID, $wpdb, $frmdb; $entry_id = $wpdb->get_var("SELECT id from $frmdb->entries WHERE form_id=5 and user_id=$user_ID LIMIT 1"); //change 5 to the ID of the linked form $where = "meta_value = ". $entry_id ." and fi.id='". $args['where_opt'] ."'"; } return $where; }October 29, 2012 at 12:54 pm
Thanks, that worked. Those filters are a life saver :)
October 29, 2012 at 5:28 pm
Is there a way to compare that value in the content area? I need to nest a few if statements with it also.
[ if 317 equals=[login]]Show something[ /if 317]
Thanks
October 29, 2012 at 6:56 pm
This will require custom code as described above.
http://formidablepro.com/help-desk/custom-display-if/
November 25, 2012 at 10:25 pm
I am having difficulty showing a list of results based on a parameter in the url. As mentioned above, I believe that it is based on the fact that it is a "data from entries" field.
I have users creating a meeting with one form. With another form users are able to choose the meeting (the data from entries field) and then put in a date and time that they are offering that meeting. Several different users can offer each meeting at several different dates and times.
In a Custom Display I would like to list the meeting along with the dates and times that it is available. I am trying to link to this list of dates and times by using the [get-param=variable], but it always just shows all of the entries.
Stephanie, I am assuming that I need a filter similar to the one above, but I've tried a few different alterations to the one that you shared. Can you point me in the right direction?
November 26, 2012 at 11:23 am
You shouldn't need any custom code. The only thing that needs to be changed is the link you are using to show the list of dates for that meeting. What is your current link?
November 27, 2012 at 8:02 pm
Link within Custom Display 1:
http://www.achieveopedia.com/command-center/steps/meetings-by-date-and-time/?meeting= moduletitle ]
In Custom Display 2:
The WHERE value is "Which meeting would you like to present?" is equal to [get-param=meeting].
No matter what the meeting is equal to in the url it still shows all of the dates and times for all meetings. I have even just typed the url in manually. I assumed that it had something to do with the fact that the "Which meeting would you like to present?" is a data from entries field.
November 28, 2012 at 7:46 am
Since its a data from entries field, you need to pass the id of the entry selected in that field. Try replacing [moduletitle] with [id].
November 28, 2012 at 9:05 pm
This didn't work. It still shows all of them. Do I need to change something in the WHERE also?
November 29, 2012 at 10:49 am
What do you have in the advanced box? Screenshot please?
November 29, 2012 at 6:03 pm
Custom Display 1
Attachment:

November 29, 2012 at 6:03 pm
Custom Display 2
Attachment:

November 29, 2012 at 6:34 pm
[get-param=meeting] is invalid. Use [get param=meeting].
December 1, 2012 at 7:55 pm
Ahh!! I swear I tried both!! :-p It works perfectly now. Thanks so much!
Topic closed.