How To: Trigger a Section When a Field Changes Value

Hi Everyone,

This has been a missing feature that I used to use all the time in PlanetPress Suit 7. So while we wait for OL to implement this into the current condition, this is a way I figured out doing it in the data mapper/designer. This code originated from OL here and with a little butchering on my part we can now conditionally trigger a section when a field changes value.

In order for you to use this with your data, you will need to change two lines of code in the data mapper. So select the OnChange field, select Use JavaScript Editor and change the below highlighted in bold to your field name. You can then copy all the code to be used in a data mapping config of your choice.

if(counter == 1) code = record.fields.ADDRESS5;
if(counter == 2) newCode = record.fields.ADDRESS5;

Once that is done you will use the OnChange field as the Datafield in a condition to enable/disable a section. To do that you simply right click a section, select Make Conditional, choose OnChange in the Datafield dropdown list, set Condition to Equal to and Value(s) false.

Below you will find the download link which contains the following:

  • On Change.OL-datamapper
  • On Change.OL-template
  • SampleData.csv
  • On Change.pdf

If anyone here has a different approach, do share, and if you think something can be optimised with what I did, I’m all ears.

Thanks to everyone who takes the time to help out and share on this forum.


Download: OnChange (Connect 2018.1.6)


Regards,

S

1 Like

This is very useful and I am sure many users will find this example useful and time saving as well. Your contribution is very much appreciated. Thank you.

Thanks Rod, that means a lot coming from you. I try to contribute as much as I can since you and the others at OL really do go beyond the call of duty on this forum. When I was a complete noob in Connect you all helped out no matter how trivial the question and are super friendly and true professionals. So if anyone deserves a thanks, it’s the OL team.

Looking forward to what Connect 2018.2 brings :slight_smile:

Regards,

S