Question

Do you have any thoughts or general ideas how to create a something like changelog using InfoPath 2013 and SharePoint Designer 2013? I don't need to archive previous versions of my form, I just need to save as a text changes made from last edit in another TextBox. For example:

  • Field1: value changed from 'aaa' to 'bbb'
  • Field2: value changed from 'In progress' to 'Finished'

Please tell me if it is possible without coding or without using any other high-level methods. This is not a specific question, a specific solution I will do on my own, but for now I don't know how to start with it and every help, including "It is impossible without coding" will be appreciated.

Was it helpful?

Solution

I've done this a few times with this method:

Create an XML file that has fields for every form field you want to track and a change flag for each field. Load the XML as a secondary data source.

Add a ChangeLog field to the form's main data source.

When the form is opened, use rules to load the current values of the fields you want to track into the fields of the XML data source (set a field's value).

Set rules on each of the form fields you want to track. When the field is changed, set the XML change flag for that field from 0 to 1. You can also tally up all change flags in a total field in the XML source.

Before the form is saved, check the XML flag total field. If it is greater than 0, some of your tracked fields have been changed. Now go check all the change flags. For each change flag that has a value of 1, take its corresponding XML value field (the old value), and the current form field value (the new value). Append these to the ChangeLog text field with a bit of explanatory text.

I've had situations where I also added time stamps and user name to the change log field. Along the lines of Change by Joe Bloggs on 1/1/2017: Status from "open" to "closed"; Color from "green" to "blue".

It's not too complex, just a bit of manual work in the setup.

The thing to understand is that an XML data source, even though it is created as a data source to read from, can very well be used to write into while the form is open. That can be a very powerful tool. You can create your own XML file with Notepad. If you need to make changes, like add more fields, just re-upload the file and re-do the data connection with Next-Next-Finish.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top