ConfiForms: Udpate ConfiForms entry - change history

Bartosz Drożdżal
Contributor
May 23, 2024

Hi @Alex Medved _ConfiForms_ 

I have such a case. In Form I have 4 fields:
Field1 - Text
Field2 - Text
FIeld3 - Text
FieldHTML - HTML

The FieldHTML field wants to store all changes that will occur in the form.
That's why I created 3 IFTTT Create/Update Entry onModified:

1) Condition: hasChanged(field1):true
Parameters to set:
entryId=[entry.id]&fieldHTML=[entry._previousState.fieldHTML] <br> [entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - New value " Field1": [entry.field1.label]

2) Condition: hasChanged(field2):true
Parameters to set:
entryId=[entry.id]&fieldHTML=[entry._previousState.fieldHTML] <br> [entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - New value " Field3": [entry.field2.label]

2) Condition: hasChanged(field3):true
Parameters to set:
entryId=[entry.id]&fieldHTML=[entry._previousState.fieldHTML] <br> [entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - New value " Field3": [entry.field3.label]

If I change the value of only one field, the history of changes is stored correctly.
The problem occurs when I change the values ​​of more than one field. The FieldHTML field shows only the change in one field.

Is there a way to update the content of a FieldHTML field if I change the value of more than one field?

Przechwytywanie.PNG

 

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 23, 2024

Hi @Bartosz Drożdżal 

This works correctly, as the "_previousState" is always the state of the record that initiated the IFTTT

Alex

Bartosz Drożdżal
Contributor
May 23, 2024

@Alex Medved _ConfiForms_ 

Do you have any idea how to make the FieldHTML field keep information about updating several values ​​at the same time?

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 23, 2024

Honestly, in this case the audit IFTTT actions sounds much more reasonable, but fine.

I would use an extra hidden field to collect the "change log" and then update the "fieldHTML"

Have a look at this demo:

https://wiki.vertuna.com/download/attachments/178782502/Community%20-%20ConfiForms-%20Udpate%20ConfiForms%20entry%20-%20change%20history.mov?version=1&amp;modificationDate=1716483671737&amp;api=v2

and the configuration as storage format is below

<p>
<span style="color: rgb(23,43,77);">
<a class="" href="https://community.atlassian.com/t5/Confluence-questions/ConfiForms-Udpate-ConfiForms-entry-change-history/qaq-p/2706522">https://community.atlassian.com/t5/Confluence-questions/ConfiForms-Udpate-ConfiForms-entry-change-history/qaq-p/2706522</a>
</span>
</p>
<p style="text-align: left;">
<br/>
</p>
<ac:structured-macro ac:macro-id="93cc9523-f547-4e3e-b48a-98b5bc9e4d32" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:parameter ac:name="debugMode">true</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="e10fc07d-8053-4919-956d-77ac3a953b0b" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="b59cfda1-de90-4088-8e52-758186a9c34a" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Field1</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field1</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="45d8ae74-816e-4fff-ac73-0505abd50188" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Field2</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field2</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="ac69d8e7-8d03-4cba-bd36-b4baeb9eff5c" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Field3</ac:parameter>
<ac:parameter ac:name="fieldLabel">Field3</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="f82b30b8-a204-4bca-a0f6-fbfdb598c2fc" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">FieldHTML</ac:parameter>
<ac:parameter ac:name="fieldLabel">FieldHTML</ac:parameter>
<ac:parameter ac:name="extras">true</ac:parameter>
<ac:parameter ac:name="type">hiddenhtml</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="3c164e8d-d78b-4346-8aba-0476041ea4fe" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeLog</ac:parameter>
<ac:parameter ac:name="fieldLabel">changeLog</ac:parameter>
<ac:parameter ac:name="type">hidden</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="45f23534-da4e-456b-86b0-6e41ec8baea8" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(Field1):true</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;changeLog=[entry.changeLog][entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - New value " Field1": [entry.Field1]&lt;br&gt;</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="3a014afd-6528-40df-a2eb-906451b30637" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(Field2):true</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;changeLog=[entry.changeLog][entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - New value " Field2": [entry.Field2]&lt;br&gt;</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="fb4a3317-e6b0-4c67-aea7-89305eb2b89d" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(Field3):true</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;changeLog=[entry.changeLog][entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - New value " Field3": [entry.Field3]&lt;br&gt;</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="bb763ec4-fb21-4369-aafd-d00146e14743" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">(hasChanged(Field1):true OR hasChanged(Field2):true OR hasChanged(Field3):true) AND !changeLog:[empty]</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;FieldHTML=[entry._previousState.FieldHTML][entry.changeLog]&amp;changeLog=</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
</ac:rich-text-body>
</ac:structured-macro>
<p style="text-align: left;">
<br/>
</p>
<ac:structured-macro ac:macro-id="a379fcf4-518a-493c-8a51-98d981418080" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">form</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="4604939d-9c92-4032-a954-0572f53b5388" ac:name="confiform-entry-edit" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="6281f462-f54e-402e-999a-2c052ecbf1f2" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Field1</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="4d1379a0-6081-4786-8a3b-a2447acc3cab" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Field2</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="6dea674f-a480-4a52-9b8c-3e839b6f0926" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Field3</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="a84a400e-b66e-489c-910d-7dc39be8eda5" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">FieldHTML</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p style="text-align: left;">
<br/>
</p>

Hope it helps

Alex

Bartosz Drożdżal
Contributor
May 24, 2024

Perfect, that's exactly what I wanted! :)

Kuanysh Belsariyev
Contributor
October 20, 2024

@Alex Medved _ConfiForms_ @Bartosz Drożdżal hello guys!

please help me figure out 
I took your template, it works perefect!  But the date field is not displayed correctly in my logs
what do i need to do?Screenshot 2024-10-21 091935.png

Bartosz Drożdżal
Contributor
October 21, 2024

@Kuanysh Belsariyev 

Are you using a Date or DateTime field?
Try using DateTime :)

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 21, 2024

What field type is that for the last item, and how do you show it? (configuration)

Kuanysh Belsariyev
Contributor
October 21, 2024
Kuanysh Belsariyev
Contributor
October 21, 2024
<ac:structured-macro ac:macro-id="146ba87b-a0a9-4931-99c5-4cc73e75e4ba" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="closeButtonLabel">Закрыть</ac:parameter>
<ac:parameter ac:name="formName">CLog</ac:parameter>
<ac:parameter ac:name="saveButtonLabel">Сохранить</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="fccfb89a-63cb-444f-8a6c-f083a270e76e" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="overrideSaveButtonLabel">Сохранить</ac:parameter>
<ac:parameter ac:name="overrideCloseButtonLabel">Закрыть</ac:parameter>
<ac:parameter ac:name="registrationButtonLabel">Создать</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="aab16bf3-61ba-4a14-a403-e9b38d610969" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c1</ac:parameter>
<ac:parameter ac:name="fieldLabel">Фамилия</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="b1d39755-126e-48d1-93ab-f01d457746ac" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c2</ac:parameter>
<ac:parameter ac:name="fieldLabel">Имя</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="9ecc709b-f02d-4364-979a-d7faf8e6d298" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c3</ac:parameter>
<ac:parameter ac:name="fieldLabel">Год рождения</ac:parameter>
<ac:parameter ac:name="extracontext">false</ac:parameter>
<ac:parameter ac:name="type">date</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="67c99a63-2487-4227-9b12-41e8b57ecf6e" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">FieldHTML</ac:parameter>
<ac:parameter ac:name="fieldLabel">FieldHTML</ac:parameter>
<ac:parameter ac:name="extras">true</ac:parameter>
<ac:parameter ac:name="restrictions">belsarik</ac:parameter>
<ac:parameter ac:name="type">hiddenhtml</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="a71c1c11-492d-43d2-9a9e-ba8b6d31a3f6" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">changeLog</ac:parameter>
<ac:parameter ac:name="fieldLabel">changeLog</ac:parameter>
<ac:parameter ac:name="restrictions">belsarik</ac:parameter>
<ac:parameter ac:name="type">hidden</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="ead15dfc-1602-49e7-b953-77014f7079bf" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(c1):true</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;changeLog=[entry.changeLog][entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] -изменил поле "Фамилия": [entry.c1]&lt;br&gt;</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="e58ccea7-7c36-4576-8e71-eddb1ffb2e48" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(c2):true</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;changeLog=[entry.changeLog][entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - изменил поле "Имя": [entry.c2]&lt;br&gt;</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="5a2c363c-c7af-47ac-abc0-7ad51288fce9" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">hasChanged(c3):true</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;changeLog=[entry.changeLog][entry._now.formatDate(yyyy-MM-dd HH:mm:ss)] - [entry._user.fullName] - изменил поле " Год рождения": [entry.c3]&lt;br&gt;</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="b1cc33ee-214e-42b2-b210-6817ae2caa9d" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="condition">(hasChanged(c1):true OR hasChanged(c2):true OR hasChanged(c3):true) AND !changeLog:[empty]</ac:parameter>
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onModified</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;FieldHTML=[entry._previousState.FieldHTML][entry.changeLog]&amp;changeLog=</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="c48093c1-9b22-4035-9a26-3c96f5e735ff" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">CLog</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="5bf5e67b-82a4-451d-99cd-aac054558acc" ac:name="confiform-entry-edit" ac:schema-version="1">
<ac:parameter ac:name="showBoth">false</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="ab5a942b-86c8-4f42-b8c5-dab910609f77" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c1</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="c6928459-c7d3-4afc-92b2-6d96c481491d" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c2</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="b93e644a-46db-40aa-9fff-6e33c5701abf" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c3</ac:parameter>
</ac:structured-macro>
</p>
<ac:structured-macro ac:macro-id="f016b00e-9223-441c-b56a-a7b9c9daf254" ac:name="confiform-entry-viewer" ac:schema-version="1">
<ac:parameter ac:name="restrictions">belsarik</ac:parameter>
<ac:parameter ac:name="buttonLabel">История</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="4d796437-1acd-4f9f-bed8-d36ab73ccb57" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">FieldHTML</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 21, 2024

Where do you set the value for this c3 field and how?

Like Kuanysh Belsariyev likes this
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 21, 2024

Oh, found it

[entry._user.fullName] - изменил поле " Год рождения": [entry.c3]

format the c3 value here using the formatDate virtual function 

Like Kuanysh Belsariyev likes this
Kuanysh Belsariyev
Contributor
October 21, 2024

Thank you very much! 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events