Auto Populate

Hi,

I have two date fields last-updated and next-update,

when i enter last-updated date then next-update field need to be auto populated (last-upadate+2years= next-update)

how can i achieve this?

Thanks,

Kavya 

  Discussion posts and replies are publicly visible

Parents
  • When your user selects a value for the 'last-updated' date you can add, on that same date field component, an a!save() to save the derived value of last-upadate+2years into the variable that you are using as the value attribute of your 'next-update' field. Assuming you don't want your user to override the 'next-update' value you should make this read-only and use a different component to display its value (i.e. the underlying variable type will be date but a read-only display of this value should be a text field, where you can use the text() function to render a friendly date, like "Tuesday 25th March 2022")

Reply
  • When your user selects a value for the 'last-updated' date you can add, on that same date field component, an a!save() to save the derived value of last-upadate+2years into the variable that you are using as the value attribute of your 'next-update' field. Assuming you don't want your user to override the 'next-update' value you should make this read-only and use a different component to display its value (i.e. the underlying variable type will be date but a read-only display of this value should be a text field, where you can use the text() function to render a friendly date, like "Tuesday 25th March 2022")

Children