and more in a single search tool across platforms. Read the announcement here. |
03/26/2024 12:25 PM
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
03/26/2024 04:04 PM
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'
03/26/2024 09:38 PM
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
03/26/2024 09:44 PM
03/26/2024 10:54 PM
Hi @rushikeshvartak ,
From the forum link you shared, it seems it is not possible to update enddate based on startdate
03/26/2024 10:33 PM
did you check here :
Setting Up Simple Form Fields (saviyntcloud.com)
03/26/2024 11:18 PM
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.