Unitfly Toolkit for M-Files logo color

How to Manipulate Property Values Based on Triggers in M-Files

Introduction

Even with modern digital tools at our disposal, manual tasks can still consume a significant portion of our daily workload.

To reduce manual work and enhance efficiency, leverage the power of automation. Within document management platforms, automating simple yet time-consuming tasks allows you to efficiently manage not only content but also your time.

In M-Files, various routine tasks can be automated without coding using the add-on Extension Kit. For example, in a scenario where M-Files is used as an HR solution, you can easily automate tasks like updating employee records.

In this blog post, explore how to automatically manipulate property values in M-Files using Extension Kit’s Property Operations module. Specifically, you’ll learn about two use cases where property values are copied or set automatically based on predefined triggers.

Let’s dive into the details of the configuration.

Manipulating property values

In this case, a user uses M-Files as an HR solution to manage all employee-related tasks.

Upon a signed contract or any changes related to the employment, the user needs to copy or set values manually. As this is inefficient and time-consuming, the user automates those tasks by setting up two rules in Extension Kit’s Property Operations module, each with one of these functionalities:

  1. Copy property values from one object to another when a trigger happens.
  2. Set property values on one object based on an event on another object.

Both rules are related to the Employee object type, and configured with the advanced mode.

Here’s a detailed rule configuration.

Use case 1: Copy property values to another property upon a trigger

When an employee signs a contract, the user manually creates an Employee Protected Data object and adds the start and end dates of the employment period from the contract.

There’s no need to do this manually. Using Extension Kit’s Property Operations, automatically copy the start and end dates of the employment period in the M-Files HR vault when, for example, the contract becomes active, or when an annex to the contract is added.

Configuration

We’ve created a rule in the Property Operations module to copy the start and end date from the Employee Contract to the Employee Protected Data object. The rule defines the trigger type, trigger source, and target like this:

  • The trigger type is Object changed to trigger the rule when a contract is changed.
  • For the trigger source, specify the object type (Document) and the class (Contract). Also, define the search conditions the object must match. We set a condition where a Contract Category is Employment to trigger the rule when this particular category changes. (Picture 1)
Define the trigger type and trigger source for copying property values.
Picture 1: Define the trigger type and trigger source for copying property values.
  • Next, we want to find the target via search. To do that, specify the search conditions for the properties Class and Employee. Set the property Class to the static value Employee Protected Data, and the property Employee to the dynamic value {Employee}. (Picture 2)
Define the target to copy property values.
Picture 2: Define the target to copy property values.
  • To copy the dates from the contract to the Employee Protected Data object, set the properties Employment Start Date and Employment End Date as the dynamic values {Start Date} and {End Date}. (Picture 3)
Set properties to target.
Picture 3: Set properties to target.

Use case 2: Set properties on one object based on an event on another object

This use case involves automatically setting property values on related objects. When an employee’s employment status is terminated, the user manually updates the employment type within the Employee class to Former.

Again, this action is easily configured to run automatically with Extension Kit’s Property Operations.

Configuration

We need to create a rule that automatically sets Employment Type to Former on the Employee class when the Employment Status becomes Terminated on the Employee Protected Data class.

Trigger the rule in a few steps:

  • Set the trigger type to Object changed.
  • Specify both the object type and the class as Employee Protected Data for the trigger source. Additionally, set a search condition where the Employment Status is Terminated to trigger the rule when this particular property changes. (Picture 4)
Define the trigger type and trigger source for setting property values.
Picture 4: Define the trigger type and trigger source for setting property values.

The next step is to define the target:

  • We need to find targets via property Employee. First, select to find the target ViaProperty.
  • Next, to define the reference property, set the reference to Employee.
  • Then, set the property Employment type to the static value Former. (Picture 5)
Define the target to set property values.
Picture 5: Define the target to set property values.

And that’s how easy it is to automatically copy or set properties on related objects in M-Files with Extension Kit.

Conclusion

Automating routine tasks in M-Files maximizes efficiency, improves accuracy, and saves valuable time.

With Extension Kit, you can harness the full potential of M-Files without the need for custom coding. The Property Operations module allows you to easily automate tasks, and get the results faster while investing fewer resources.

In this text, you’ve discovered how to automatically trigger copying or setting property values based on specific actions in M-Files using Property Operations. Through the example of M-Files as an HR solution, we’ve illustrated how automation enriches the user experience.

To discover more capabilities of the Property Operations module, explore how to automatically change workflow states on related objects in another use case.

If you’re interested in experiencing firsthand how Extension Kit can streamline your M-Files implementation, sign up for a free trial and download our demo vault.

Schedule a consultation

Let’s talk about the ways we can help your business thrive. 

Your one-stop hub for Unitfly Toolkit for M-Files!

Unitfly Toolkit Community is live!

News and updates on our products • Frequently asked questions • Support page