Use dropdown value to populate a field

Ask your questions here.
Post Reply
StuartB_75
Posts: 227
Joined: 24 Sep 2018, 23:22
Name: Stuart B
Location: Manchester UK

Use dropdown value to populate a field

Post by StuartB_75 »

Hi, I’ve searched the other posts but I can’t seem to find anything, so I’ll try and describe what I’m trying to do.

I have a dropdown field with several options. If a user selects a certain option I’d like another field in the same entity to populate with a defined value.

For example, if (field#149) is a dropdown with options: ‘No answer’, ‘dummy’ or ‘no access’ the I’d like the empty (field#600) to be populated with the value ‘N/A’.

I’ve tried to do it with an Ajax field, but that involves creating a new entity to hold basic values. It also doesn’t work with Display Rules to control the form.

Hope that makes sense. Any help would be much appreciated.
Stuart
enishemed
Posts: 639
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Use dropdown value to populate a field

Post by enishemed »

I think you can use MySQL formula field using CASE statement.

https://docs.rukovoditel.net/index.php?p=25
gpmio
Posts: 32
Joined: 23 Jul 2020, 20:08
Name: Guy Miotke
Location: US Mesa
Company Name: Fat Lip Marketing
Contact:

Re: Use dropdown value to populate a field

Post by gpmio »

Is the MySQL for numeric type field sonly? It is listed under 'Numeric'. I was trying to use MySQL to show the fefault email if there was not a billing email in the client table but i could not get it to return any data regardless of when the field was null or not
StuartB_75
Posts: 227
Joined: 24 Sep 2018, 23:22
Name: Stuart B
Location: Manchester UK

Re: Use dropdown value to populate a field

Post by StuartB_75 »

Hi, and thanks to gpmio & enishemed for a little direction. I've tried to use the mySQL function of CASE but I don't get the result I'm expecting. I'm very new to SQL, so please bear with me, but I would really appreciate a little more direction if possible.
To recap, I have Entity #30 which contains Field #275 (a dropdown list). Within the several options in the list is #138 which I've given the value of '1'. Also within Entity #30 is Field #286 which is an input field set as text. The formula I've written is:

CASE
WHEN [275]=(138) THEN
([268]='TEST OF N/A')
ELSE 0
END

I was hoping that this would check field #275 and, if it was #138, then update the value of text field #268 with the phrase 'TEST OF N/A', but I get nothing happening at all. No errors created or anything, so I'm not sure what might be happening. If there's a SQL guru that might be able to assist it'd be much appreciated.
Thanks in advance
Stuart
Post Reply