avatar image
1
use regex to show info from mutation record
By Created , last editted

When you activate the mutation history, the complete contents of the mutation record is stored as a json like object. The default details page will show you the old- and new values, but i want to show these values in regular list views. 

To do this, i created some additional properties on the _mutation table:

old_value: text expression: mmatch(var:record.mutations, "\"volledige_naam\"\:\"([\s\S]*?)\"\}", 1)

new_value: text expression: mmatch(var:record.mutations, "\"volledige_naam\"\:\"([\s\S]*?)\"\}", 2)

The exact formula depends on the contents that was changed. For us, this was wat we needed. Might be helpful for others. 


When you activate the mutation history, the complete contents of the mutation record is stored as a json like object. The default details page will show you the old- and new values, but i want to show these values in regular list views. 

To do this, i created some additional properties on the _mutation table:

old_value: text expression: mmatch(var:record.mutations, "\"volledige_naam\"\:\"([\s\S]*?)\"\}", 1)

new_value: text expression: mmatch(var:record.mutations, "\"volledige_naam\"\:\"([\s\S]*?)\"\}", 2)

The exact formula depends on the contents that was changed. For us, this was wat we needed. Might be helpful for others. 

Answers
Sort by:

Please login to reply to the topic.