Previous value of field in calculation

Hi,
would it be possible to capture the previous value of a field in a workflow calculation?

Use case:
Record the previous stage, before a decision was made in a Deal. Is interesting to analyse for “deselected” deals, when we switched to “deselected”. Was it before an offer was made or later in the process?

The trigger already allows to check for previous values. Would be cool to use that previous value in an automation. Otherwise I would need to setup up x automations to test for the previous value, which doesn’t sound like the right way to do it.

image

Adding thumbs to it, I would like to know if the change log in future will keep previous data record, as the log feature at Podio, where it is possible to undo an edit.

This is very useful for record changing control, we lose this control when migrating to Tape, we already have cases in which the data was changed wrongly at Tape and it the previous data was lost, so we missed this feature.

I am not sure that this is exactly what you are after but in case you were not aware @toni then this video gives an example of recovering values:


More complex bit

You can also get revisions with the RecordRevision although obviously more complex depending on what you want to achieve:

await tape.setApiKey(collected_api_key_field_apikey_value); //You have to set your API key

// This gives you a 'list' of all the changes to the record with the revision number, its type, who made the change and when it was changed:
const revisions = await tape.RecordRevision.getMany(current_record_id); 
console.info(JSON.stringify(revisions,null,2));

An example would look like:

{
  "revisions": [
    {
      "created_by": {
        "id": 17267,
        "mail": [
          "jason@jmc.tools"
        ],
        "user_id": 17267,
        "name": "Jason",
        "org_id": 1484,
        "type": "user"
      },
      "created_on": "2025-01-12 15:10:12",
      "record_id": 137914463,
      "revision": 0,
      "type": "creation"
    },
    {
      "created_by": null,
      "created_on": "2025-01-12 15:10:15",
      "record_id": 137914463,
      "revision": 1,
      "type": "update"
    },
    {
      "created_by": {
        "id": 17267,
        "mail": [
          "jason@jmc.tools"
        ],
        "user_id": 17267,
        "name": "Jason",
        "org_id": 1484,
        "type": "user"
      },
      "created_on": "2025-01-12 15:10:15",
      "record_id": 137914463,
      "revision": 2,
      "type": "update"
    },
    {
      "created_by": {
        "id": 17267,
        "mail": [
          "jason@jmc.tools"
        ],
        "user_id": 17267,
        "name": "Jason",
        "org_id": 1484,
        "type": "user"
      },
      "created_on": "2025-01-12 15:10:18",
      "record_id": 137914463,
      "revision": 3,
      "type": "update"
    }
  ],
  "total": 4
}

Then if you wanted to get the original back that would be revision 0

const original = await tape.RecordRevision.getRevision({recordId: current_record_id, revisionId: 0}); 
console.log(JSON.stringify(original,null,2));

which would provide you with:

{
  "record_id": 137914463,
  "app_record_id": 3,
  "app_id": 52669,
  "created_on": "2025-01-12 15:10:12",
  "created_on_utc": "2025-01-12 15:10:12",
  "last_modified_on": "2025-01-12 15:10:18",
  "last_modified_on_utc": "2025-01-12 15:10:18",
  "deleted_on": null,
  "deleted_on_utc": null,
  "fields": [
    {
      "field_id": 527218,
      "external_id": "name",
      "label": "Name",
      "type": "text",
      "field_type": "single_text",
      "config": {
        "label": "Name",
        "slug": "name",
        "external_id": "name",
        "show_description": false,
        "required": false,
        "always_hidden": false,
        "hidden_if_empty": false,
        "settings": {
          "formatted": false
        }
      },
      "values": [
        {
          "value": "new"
        }
      ]
    },
    {
      "field_id": 527221,
      "external_id": "number_one",
      "label": "number one",
      "type": "number",
      "field_type": "number",
      "config": {
        "label": "number one",
        "slug": "number_one",
        "external_id": "number_one",
        "show_description": false,
        "required": false,
        "always_hidden": false,
        "hidden_if_empty": false,
        "settings": {
          "decimals": 0,
          "unit_label": null,
          "unit": null
        }
      },
      "values": [
        {
          "value": 100,
          "formatted": "100"
        }
      ]
    },
    {
      "field_id": 527222,
      "external_id": "number_2",
      "label": "Number 2",
      "type": "number",
      "field_type": "number",
      "config": {
        "label": "Number 2",
        "slug": "number_2",
        "external_id": "number_2",
        "show_description": false,
        "required": false,
        "always_hidden": false,
        "hidden_if_empty": false,
        "settings": {
          "decimals": 0,
          "unit_label": null,
          "unit": null
        }
      },
      "values": [
        {
          "value": 200,
          "formatted": "200"
        }
      ]
    }
  ],
  "created_by": {
    "mail": [
      "jason@jmc.tools"
    ],
    "id": 17267,
    "user_id": 17267,
    "org_id": 1484,
    "name": "Jason",
    "type": "user",
    "phone": "",
    "email": "jason@jmc.tools"
  },
  "last_modified_by": {
    "mail": [
      "jason@jmc.tools"
    ],
    "id": 17267,
    "user_id": 17267,
    "org_id": 1484,
    "name": "Jason",
    "type": "user",
    "phone": "",
    "email": "jason@jmc.tools"
  }
}
2 Likes