As a standard practice, we include the drag and drop user_id field on every form we build. Having the data in the form's metadata makes user id related queries easier.
I just ran an experiment on my dev server to see what Formidable does with user_id values. This is the experiment:
1. Added user_id to catchall play form.
2. Previewed form in theme
3. Opened browser inspection tool to examine user id field's HTML. The hidden user id field is cryptically displayed. You cannot know this is a user id variable without the field id number. Look for name="item_meta[1462]" where the 1462 is the field id of your form's user_id field.
4. Change the value="1" data-frmval="1" to different numbers
5. Submit entry
6. Examine frm_items and frm_item_metas in PHPMyAdmin and compare user id fields.
Results:
In each of three experiments testing permutations of the value and data-frmval combination, the outcome was the same. The user_id field in frm_items and the user_id meta field are identical. Formidable used the fake id number submitted as a test. There is no WordPress user id corresponding to the number submitted in the test. Formidable does not appear to validate the user id against the WordPress user table.
Conclusion:
There should be nothing standing in the way of the user id field in Form 2 not getting populated. Maybe there's something wrong with your mapping. All I can suggest is that you may need to consider hiring a developer to take a look. The problem seems to be with your system, not the user id field. Torubleshooting this is beyond what we can do as volunteers here. To find a developer, please visit https://formidable-masterminds.com/developers-directory/
Something else to try, are the two forms in the same Formidable instance or in different servers? If they are in the same instance and the same admin user has access to both forms, set the default value to [user_id] in the second form. If you want the user id to be something other than the same admin user, talk to a dev.
Thanks for your comments, Victor. I've done more testing and found that I can map the field in Form 1 to a text field, and a hidden field in Form 2 and the values are indeed populated the same.
My issue is that I need to create a single entry View where User ID = current_user, based on Form 2.
By way of workaround, I thought that I may be able to use the nested Views method with Form 2 as the detail, and using some other user-unique value like email address as the parameter passed in from Form 1, but since there's *always* an email address, it'll always return the latest entry, but not one unique to the current user.
Since the Value *is* coming through in a hidden field, I wish there was someway to filter the View where User ID = [key of hidden field]. That'd be a decent workaround. What's weird, is this had worked in lots of other things, just not this one. And of course, it's a critical workflow enhancement. 🙂
Please login or Register to submit your answer