How to set the current date as default date in read only mode in a digital form?

I would like set the date field in the digital form with following settings -

  1. Current date as default date (user should not able to change )
  2. in Read only(This I can achieve)

Would be helpful If this info can be provided ASAP.

Thank you.

Hi @ramsetti.sandhyarani ,

Thank you for reaching out to Kore.ai Community
Please refer to the below documentation for more information on using Digital Forms.

Please drag and drop the date component to the form and configure the values as shown in the below screenshot.

Hope this helps.

Thank you,
Srujan Madderla
Kore.ai Community Team

Thank you @srujan.madderla for providing the information. How can I save the current date in the context variable to fetch it dynamically in the form. I want to show the current date in the field and want to pass that value to my API call.

Ramsetti,
Have you tried the form prefill function? Here’s the basic format for use in a script node:

context.prefillForms = {
your_form_name: {
fields: {
your_form_field_Name1: context.your_date_value, // or use new Date()
your_form_field_Name2 : context.entities.your_entity_nodevalue
},
},
};

Please note that you will use the form field Name , NOT the Display Name.
The date value can be static, a variable or generated in the script.

Good luck!

1 Like