Skip to main content
Participant
April 11, 2022
Question

Auto fill based on Age range

  • April 11, 2022
  • 1 reply
  • 1160 views

Hi!

I am looking to have a field auto fill given an age range. 

If age range is 45-100, I would like the field to auto populate a "4"

If age range is 1-44, I would like the field to auto populate a "0".

 

Someone please help 🙂

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
April 11, 2022

Where do you get age from, is it from same field you wish to auto fill?

Participant
April 11, 2022

Hi Nesa,

Age is calculated by a future date and is alerady auto filled. 

 

I am looking to have another field either populate a 4 or 0 depending on the age that has been calculated. 

IE if the person is 45 years of older - a 4 will be populated a field titled "weeks"

if the person is under 45 years of age - a 0 will be populated in the field titled "weeks"

Nesa Nurani
Community Expert
Community Expert
April 11, 2022

As 'Validation' script of  field with age, use this:

this.getField("weeks").value = event.value >=45 ? 4 : 0;