Hi I have used days trying to figure out why i cannot filter my view based on a user_meta in my form view. I have a meta field for some of the users reffering to their company. When I filter the view with ´Company equals [user_meta Key=Company]´ no results show, either as admin or as logged in user. The filter works fine when i write a company name. Is there some settings or connections i have to set up for this function to work in my view.
And, are you absolutely sure the test users are logged in and the key/value pair exists in the wp_usermeta table for the logged in user id?
Last, does the user id saved in the entry match the logged in user id?
WordPress user IDs stored with entries belong to the logged in user entering the data. The logged in user is always regarded as current_user.
Your design requires you to store a different element in the entry to serve as your view filter. You cannot depend on user IDs. I also wouldn't depend on the user_meta shortcode as a view filter parameter unless I was passing the user meta to view as a parameter and using [get param] in place of [user_meta]
If this were my project, I probably would have created a company lookup form and use dynamic fields for the certificates. Here's why. When you use lookup records with dynamic fields, Formidable stores the entry ID of the lookup record. If you have 100 people working in the same company with access to the same data, if you store the Company value for all 100 staff, what happens if the company name changes or you notice a spelling error after the fact? You have to modify 100 individual records to apply the correction or do it through SQL and manipulating the database directly.
If you encountered the same scenario with lookup tables and dynamic fields, you only have to edit the record in the lookup table once and all 100 employees are immediately updated across the system. The link to the lookup table with dynamic fields is more or less permanent and makes it a whole lot easier to use data common to many users that is not a user id. Please consider rethinking your design.
Thanks!
I'm familiar with normalization of databases, but i don't quite understand how this works is in Formidable. I have a Company table (form) and are using lookup to fetch the company name. (in fact i also have a location form feching both company and location from this. I do the same for equipment makes and models and pull everything togeher in my certificate overview page. In this everything looks like it in plain text when stored to the table.
I have tried to understand where i should put any code for a function like [get_param] and how to do this. I think the best solution would be to somehow ask for only the data where company name equals the users Companyname. This is for me the core functiality in a databse and I have looked for a easy plug and play solution for this. I guess some shortcode is needed - I am looking for a step by step explanation on shortcodes, but can't find this
Thanks!
I'm familiar with normalization of databases, but i don't quite understand how this works is in Formidable. I have a Company table (form) and are using lookup to fetch the company name. (in fact i also have a location form feching both company and location from this. I do the same for equipment makes and models and pull everything togeher in my certificate overview page. In this everything looks like it in plain text when stored to the table.
I have tried to understand where i should put any code for a function like [get_param] and how to do this. I think the best solution would be to somehow ask for only the data where company name equals the users Companyname. This is for me the core functiality in a databse and I have looked for a easy plug and play solution for this. I guess some shortcode is needed - I am looking for a step by step explanation on shortcodes, but can't find this
Neither WordPress nor Formidable use normalized table structures. They use the metadata schema.
Please login or Register to submit your answer