Workflow: How do i check previous value of a field after change

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • murugappan
    Active Community Member
    • Aug 2017
    • 510

    #1

    Workflow: How do i check previous value of a field after change

    I have the need to to do the following:

    (1) Check if a field has been changed
    (2) If changed and if the previously value is empty set the status of the entity record

    Example. If if the "Date Doc. Received" has changed and if it was previously empty, then set the status to "Received".

    Thank you for any assistance.
  • emillod
    Active Community Member
    • Apr 2017
    • 1529

    #2
    If you're doing it via GUI you can think about previousStatus field where you'll be storing value of previous status like in Opportunities.

    Comment

    • victor
      Active Community Member
      • Aug 2022
      • 1054

      #3
      Tested on the description field, it works. Here is a screenshot for Conditions:

      Click image for larger version

Name:	image.png
Views:	0
Size:	44.1 KB
ID:	123122

      All you have to do is add your Actions.

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1354

        #4
        Originally posted by murugappan
        I have the need to to do the following:

        (1) Check if a field has been changed
        (2) If changed and if the previously value is empty set the status of the entity record

        Example. If if the "Date Doc. Received" has changed and if it was previously empty, then set the status to "Received".

        Thank you for any assistance.
        i would use only formula (using both conditons and formula can cause a race and might cause issues) - this is a simple check that can be done using only formula as below

        PHP Code:
        entity\isAttributeChanged('description') && entity\attributeFetched('description') == null 
        Rabii
        EspoCRM & Web Dev

        🔗 See what I’ve built for EspoCRM

        Comment

        Working...