Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Auto populating date attribute based on another attribute in Create user form

haardik_verma
Regular Contributor
Regular Contributor

Hi,

The use case is that in the Create User form, there will be a "StartDate" attribute that will have the default value as today but will be editable by the person filling the form.

We want another attribute "EndDate" that should always be "StartDate + 90 Days"

The EndDate should be refreshed and updated if the user changes the StartDate in the form.

Currently, I have kept the default value of StartDate as ${new Date().format("MMM dd, yyyy")} which works fine.

If the use case was that the StartDate is not editable, then I could have kept the EndDate default value as ${new Date().plus(90).format("MMM dd, yyyy")} and this would have worked.. But in our case the StartDate is editable.

Please guide on how to auto-populate/auto-update value of EndDate, based on change made in StartDate during new user form filling.

 

Thanks


Thanks & Regards,
Haardik Verma
6 REPLIES 6

PremMahadikar
Regular Contributor III
Regular Contributor III

Hi @haardik_verma ,

The enddate dynamic attribute(DA) definitely requires a refresh to make the value auto populated.

Solution to this would be:

Create another dynamic attribute: generate

Label:Generate End Date
Attribute Type: Single select SQL query
Value: select 'Yes' as ID union select 'Regenerate End Date' as ID
What actions to perform when parent attribute changes: Mapping

Next step is to add this new DA 'generate' in 'enddate' DA under 'Parent Attribute'

Working:

1. For the first time, when user selects startdate - click 'Yes' under Generate End Date - this would generate enddate

2. If the user again want to update startdate before submitting, which also needs to re-generate enddate - Click on Regenerate Enddate - this will re-generate enddate

 

If this answers your question, please consider selecting 'Accept As Solution' and hit 'Kudos'

Hi @PremMahadikar ,

What should be the logic for EndDate? so that it is startdate+90 days?
I tried the below 3 options.. 

${${StartDate}.plus(90).format("MMM dd, yyyy")}

${StartDate.plus(90).format("MMM dd, yyyy")}

${StartDate.plus(90)}

${${StartDate}.plusDays(90)}

${StartDate.plusDays(90)}

 

But these either do not work, or print the above statement in the UI, or give the enddate in 1990 or I get this error when I open the create user page

haardik_verma_0-1711513778835.png

 


Thanks & Regards,
Haardik Verma

Refer https://forums.saviynt.com/t5/application-access-governance/create-user-form-set-enddate-startdate-1...


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak ,

From the forum link you shared, it seems it is not possible to update enddate based on startdate


Thanks & Regards,
Haardik Verma

did you check here :

Setting Up Simple Form Fields (saviyntcloud.com)

Validating Field Values on the User Registration Form

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

Hi @Manu269 ,

Yes I have checked the documentation Setting Up Simple Form Fields (saviyntcloud.com)

But many things mentioned there, do not work for me. I tried the country one for example, It does not show me the list of available countries.

Not sure if the documentation is wrong or something wrong with my environment.


Thanks & Regards,
Haardik Verma