Can I pre-populate the edit URL link with the system date?

  • Profile Image
    ocstokrode
    Asked on December 16, 2020 at 12:18 PM

    I have an additional question about my previous question for the edit link. This one
    To make it easy for Jotform I created an additional topic cause it's another question.

    In short my issue:
    A customer will book a reservation and after completing the form he will receive a confirmation mail with all details of his reservation. So he can check if everything is correct. But it's always possible he has make a mistake, and then he's able to make corrections using the edit link. So far so good.

    After 3 days we'll send the the customer an official order confirmation, from then his reservation is final accepted. From now on the customer should not be able to make any changes in the original reservation form.

    And that's the point: how can we prevent the customer he can't use the edit link anymore after 2 days, counting from completing his reservation. So the customer will have only two days to use the edit link in case he would make corrections. After two days it should be impossible for him...

    To solve the problem I was thinking on this workflow:

    (1) I will create a (hidden) date field in the form. The value of this field contain the actual date: the date the customer will supply the reservation form. That's easy...

    (2) I will also create an additional text field in the reservation form.
    When the customer uses the edit link, the actual date (system date) of the customer's computer should be populate the addition text field.


    1608135340_5fda32ac3f335_voorbeeld.jpgWhen this could be possible, then it would be wonderful.
    Then we can make a calculation field that detect how many days will be the difference between 'original subscription date' and the 'system date of the editing'.

    When this calculation will be >2 days, then we use conditions and hide all fields of the form. And show a text saying the time to make changes has been expired. So the customer will see an empty form and he can't do anything more.

    When the calculation of the day difference is only 1 or 2 days, then of course he will get his whole subscription and he's able to make changes.

    And THEN I achieve my original question to make a time limit for the edit link.
    Then we can do the same thing with a work around.

    Only thing to solve: how to populate the edit link with the actual system date?
    Will this be command as www.jotform.com/edit/{id}?newdate=date() or something in this way?

    I'm curious ...
    Thanks a lot !

  • Profile Image
    Katherine_W
    Answered on December 16, 2020 at 02:46 PM

    Hi there,

    Happy to help! And thank you for addressing your separate question in a separate thread as this will certainly help to avoid confusion and allow us to address each of your questions in a timely manner.

    In regards to this question, your workflow makes sense: please allow me a little time to investigate and test some URL parameters to put together a potential solution for you.

    I appreciate your patience and understanding as I work to find a solution for you.

  • Profile Image
    ocstokrode
    Answered on December 20, 2020 at 03:35 AM

    Hi Katherine_W

    Do you already have news for me?

    Best regards

  • Profile Image
    Katherine_W
    Answered on December 21, 2020 at 03:52 PM

    Hi again,

    Thanks for your patience as I investigated this and created a solution for you!

    I wanted to ensure that this solution I proposed would work best for your use case. In this case, I believe that using the DateTime field will work best for pulling the current date:

    1608573881_5fe0e3b909615_

    Then, you would need to find the Field ID name of this field: do to so, click in to the field's properties

    1608579158_5fe0f85678582_

    Click the ADVANCED tab, and then scroll down to the Field Details:

    1608583432_5fe109080db41_

    And then you can enter in the details like in the example URL parameter here:

    https://form.jotform.com/203516571563051?date[month]={date:month}&date[day]=&date[year]={date:year}

    I hope that this helps! Please let us know if we can help further.