How do I Auto-fill a date based on the condition of another field?

  • 25 October 2017
  • 5 replies
  • 12 views

Badge +6

I have a status field (dropdown) with 7 total options.  And 2 date fields (date picker).

2 of the options are Started and Completed.  And the Date fields are Started Date and Completed Date.

If the User selects Started/Completed from the dropdown, I would like the corresponding date fields to auto-fill to TODAY.

Any help?


5 replies

Badge +8

Seems like you could create a workflow that runs on item change that checks the value of the dropdown. It value=started or completed just add a "set field value" action to update the started date or completed date. Just check the "Use date when action is executed" box.

210087_pastedImage_1.png

Userlevel 4
Badge +10

Hi ‌,

Do you want this to happen live, in the form or do you want a workflow to edit the date after submission? One concern if you have it edit live in the form, suppose you are well into the process and someone accidentally selects Start and over writes the start date then says oops, and selects the correct status, yet does not notice the date change. You may want to consider this in you solution.

Live on form can be done with a little JS I think and in the subsequent workflow, ‌'s solution above should suit you. If Roger's works for you be sure to mark him as correct.

Userlevel 5
Badge +14

have a look here how to set date control value within the forms with javascript

https://community.nintex.com/message/34952?commentID=34952#comment-34952 

you will have to add there a check for two specific choice values.

Badge +3

I also have this same need, and I would like it to happen immediately  on the form before the user saves the form - which would allow the user to change the date if they need to. (I know I could develop a workflow for this, but I worry about long term use and possibly clogging up the server with workflows when it might be cleaner/more efficient if it's immediately done in the form.) 

I have a form with a task status field and a Start Date and a Completed Date field. When anyone changes the status to "In Progress" I would like the Start Date to auto populate with Today's date, similarly, I would like it to auto populate the Completed Date field if anyone changes the status to Completed. 

I don't know how to write or configure formulas on my own yet, but I'm thinking this formula should include an element that says something to the effect of If Task Status equals In Progress then Today's date in Start Date field If it was currently blank - but don't do anything if it already has a date (and another one just like that for the Completed status.)

Would that be complicated? Or should I just use the workflow?

Badge +1

I have a similar issue, However i had a Javascript solution on the Classic Form.

Now i need to try and find a solution for the responsive forms.

 

Please let me know if anyone finds a solutions :'(  :catsad:

Reply