Conditional logic not working for hidden fields? [RESOLVED]

Hi, could use some conditional logic help! I’ve been fighting with it for a few hours and not making any real progress.

I am trying to display a specific field (either a dropdown or a “consent” checkbox that is a selector to ask us to do something) based on the values in another hidden field that are being populated with Populate Anything.

Basically the logic for what I am trying to do is “If the current user’s meta field of random_meta_field has a value of 1, show this gravity forms field.” It’s basically a feature based off their permissions and what they’ve bought.

Hidden field 1 is a dropdown. It populates all of the users whose random_meta_field is 1. Populate Choices Dynamically is set to random_meta_field is 1 AND User ID is Current User ID. I can verify with Inspect Element that the user for whom this is true is being populated (I don’t love this because someone could supposedly do the same and find some info on other customers…)

Then Field 2 is another dropdown with 2 options, Yes and No. Conditional Logic is set to “Show this field if All of the following match: random_meta_field contains {user:id}.”

No dice. I’ve tried contains user:display_name and all sorts of stuff. It just won’t show with anything.

What am I doing wrong? How would you accomplish this if you were me? And most importantly, what might be the simplest solution?

Many thanks in advance.

If I was faced with this problem, I think I’d handle it by using php code and using the gform_pre_render hook: https://docs.gravityforms.com/gform_pre_render/

You could use php to check the current user’s ID and figure out if they qualify and then use a little more php to, if necessary, add a css class to field 2 to show or hide it as appropriate. This avoids the issue of exposing customer data in the html, which sounds like a really bad idea.

But I realize that if you don’t know php this solution may not be viable for you.

Got it, thanks. The Gravity Wiz team sorted me out.