Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
I have a requirement I have datetime component user can select the time maximum 2 hours from their current time else there should be validation error , i want to show the current time defaulted in the time field and they should select the time upto 2 hours . It should be in est . Can anyone help me with this
Discussion posts and replies are publicly visible
Try this
a!localVariables( local!selectedTime: now(), a!dateTimeField( label: "Select Time (max 2h from now)", value: local!selectedTime, saveInto: local!selectedTime, validations: ( if( local!selectedTime > addhours(now(), 2), "Select time within 2 hours from current time", {} ) ) ) )
In addition to this, if you're pre-setting the value i.e. in "local!selectedTime", and it's the save target as seen here, assuming it's in a task where the value is expected to be saved somewhere, the "Submit" button (preferably, among various options) will need to make sure to save the value contained in "local!selectedTime" into the Rule Input value (and/or whatever CDT or Record Data is being passed out of the form upon submission), otherwise the user's selected value will just get lost upon submission.