You are viewing limited content. For full access, please sign in.

Question

Question

Forms: Field rules based on value in dropdown populated by lookup?

asked on February 7

Hi all,

My situation: I have a dropdown field on a form. It's populated by a lookup rule.

When I attempt to configure a field rule to show a different field based on the value selected from this dropdown, there are no values for me to select:

Am I forced to hard-code these values into the dropdown on the Layout tab?

Thanks,

Rob

0 0

Answer

SELECTED ANSWER
replied on February 8 Show version history

What version are you using?

One solution would be to populate a field with what you select form the first drop down. Use the formula in the field:

Then point your second lookup to this value instead of your first drop down. Of course, you would want to hide this field with Field Rules.

Another thing to try is to use javaScript to trigger a .change with a timeout. In other words .on('change', of the first drop down, trigger .change() with a setTimeout set for a fraction of a second like 250 or 500.

Hopefully one of these works for you!

 

1 0
replied on February 9

I was going to suggest the same thing. If the hidden field is a single line you can type your value in the field rule and bypass the empty drop down issue. The functions trigger all the necessary change events, so I’ve used this approach for similar things.

1 0
replied on February 12

@████████ and @████████, much appreciated! I ended up going with the hidden single line field. It's been a while since I've needed to implement something like this so it completely slipped my mind. There are too many possible outputs (and there will very likely be more in the future) for the JS route to be easily maintainable.

 

1 0
replied on February 12

Nice work!

0 0

Replies

You are not allowed to reply in this post.
replied on February 9

I was going to suggest the same thing. If the hidden field is a single line you can type your value in the field rule and bypass the empty drop down issue. The functions trigger all the necessary change events, so I’ve used this approach for similar things.

You are not allowed to follow up in this post.

Sign in to reply to this post.