Page 1 of 1

Update Field Based on Another Field in Table

Posted: 2022-04-25 15:59
by rpierce
Hello AppGini family,

I have a question that has probably already been asked and answered, but I can't find it.

I have a table that includes a "closed" field that is a radio button with the options of Yes and NO. This is a required field.
There is another field called "close_date". It is not required and default value is null or empty.

What I want to do is remove the Required parameter from the "closed" field and automatically update the field to "Yes" if the "close_date" field is a non null value and to "No" if the close_date field is a null value.

I hope someone can help.

Ray

Re: Update Field Based on Another Field in Table

Posted: 2022-05-10 10:24
by tchandra
you can use calculated field to automatically assign closed to yes if closed_date is not null

closed_date as date, no default
closed as calculated field, read only with calculated field below :
SELECT IF(ISNULL( `TABLENAME`.`closed_date`),0,1)
FROM `TABLENAME`
WHERE `TABLENAME`.`id`='%ID%'

Re: Update Field Based on Another Field in Table

Posted: 2022-10-07 23:13
by rpierce
Hi tchandra,

I have tried using the calculated field as you suggest, but it just leaves the field blank. I have changed the SELECT IF(ISNULL( `TABLENAME`.`closed_date`),0,1) to SELECT IF(ISNULL( `TABLENAME`.`closed_date`),No,Yes) and no luck.

Any ideas?

Thanks

Re: Update Field Based on Another Field in Table

Posted: 2022-10-07 23:55
by rpierce
I got it figured out. Thank you!