Send Email and Update Field

Send Email and Update Field

I am working on a project that I need to send an email then update a field in the record with the current date (Date Sent) have the sending email taken care of but was needing to be pointed in the right direction as far as updating the field....Thanks
Hi James,

Whener you define an Entity in Service Studio, you immediately have available a a Data Access Layer. To query data from your table you can use simple queries or advanced queries and to update data in the database you can use on of the Entity Actions available - Create<Entity>, Update<Entity>, CreateOrUpdate<Entity> and Delete<Entity>.

In the image below, you can see the Entity Actions of a NOTIFICATION entity.

For example, imagine you want to send an email and, afterwards, update a NOTIFICATION record SentDateTime time to the current date.

A valid flow to do that would be the following:
  1. Send the email with the SendEmail tool;
  2. Get the NOTIFICATION record you want to update from the database using a Simple Query;
  3. Assign a CurrDateTime() value to the NOTIFICATION.SentDateTime field;
  4. Save the NOFICATION record back to the database using the UpdateNOTIFICATION action;

Please tell me if this clarifies your issue.

Kind Regards,

Daniel Lourenço