User ID field always get

By: Jordi Valls | Asked: 05/03/2024
ForumsCategory: General questionsUser ID field always get
Jordi Valls asked 2 months ago

Hi, I'm using the "User ID" field with Formidable Forms PRO and no mater what default value i define [email], [last_name], [user_id], [post_id],[ip], ... I always get the first_name value. Any idea what the problem could be? Thank you!

2 Answers
Rob LeVineRob LeVine answered 2 months ago
Can you give some very specific examples of where and how you use it?
Jordi Valls replied 2 months ago

Hi Rob,
On any form, when i add a UserID Field i only get the First name value. I have uploaded an image on my first post, in this case "J" is the logged user first name.

Rob LeVineRob LeVine replied 2 months ago

I created a form with the text, email and user id fields. Then, as a logged in user, created a new entry and the email field was properly filled in with the email address of the user. I'm guessing you're using it differently. Can you explain your scenario?

Jordi Valls replied 2 months ago

I do exactly the same. But instead of the user's email, id or any other user data, I always get the first_name of the logged in user. As I said on my original question no mater what default value i define [email], [last_name], [user_id], [post_id],[ip],... The entry always show the first_name value.

Rob LeVineRob LeVine replied 2 months ago'. I'd have to debug it first hand to have a clue. The only thing I can think of off the top of my head is to replace the [email] shortcode with your own custom shortcode that just returns "XYZ" or something and see what happens there. My motto is, "The odder the bug, the more facepalming will be involved in the solution."

Jordi Valls replied 2 months ago

I'm going to try debugging it with a custom shortcode. Thank you!

Jordi Valls answered 2 months ago
I have solved it. It was my mistake when I believed that the "User ID" field allowed me to save different values referring to the user such as email or last name when configuring it as the default value. No, this field always saves the user's ID (as long as the user is logged in). Once the sending has been made in the personalized visualizations, the user's data can be obtained with shortcodes, but the stored value is always the user's id. To save specific values such as the user's email instead of the User ID field, you must use a hidden type field and configure the default value with shortcodes like [email] [first_name] [last_name] ...

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