Jump to content
james1234

Change A Field When A Date Is Added

Recommended Posts

hello I am new to Caspio and really need a little help.

 

I need to have my field Response updated when a date is added or changed to the field ServiceDate. 

 

The Response should be "New Date", "Updated Date" or null (if the value was not changed).

 

ANy assistance would be greatly appreciated!!

Share this post


Link to post
Share on other sites

Hello James,

 

I think, you can add Header&Footer element and add the following code:

<SCRIPT LANGUAGE="JavaScript">
var beforeDate = document.getElementById("EditRecordmyDate").value;

function checkStart()
{
   var afterDate = document.getElementById("EditRecordmyDate").value;
   if (afterDate==beforeDate) { }
     else
       {
          var status_update = document.getElementById("EditRecordupdated").value;
          if (status_update == "") {status_update = "New Date"}
             else {if (status_update == "New Date") {status_update = "Updated Date"} }
         document.getElementById("EditRecordupdated").value = status_update;
       }
}   
document.getElementById("caspioform").onsubmit=checkStart;
</SCRIPT>

Please, enter names of your fields instead of "myDate" and "updated".

I tried with field with name "updated" that is Hidden and myDate that is text field.

 

I hope it helps.

Share this post


Link to post
Share on other sites

Hi @james1234,

Just to add from the previous comments above, you can also use Triggered Action. Triggered Actions allow data manipulation, calculations and sending notifications by constructing application logic with a visual interface. They will be executed on specified events to perform actions on data in your tables. Changes in one table can affect data in other tables.

Kindly check this link for more information: https://howto.caspio.com/tables-and-views/triggered-actions/

 

-kristina

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...