SetFieldProperties Use Examples
Basic SetFieldProperties Use
In this webpage we have a button called “Save”. This button has a process which uses the “SetFieldProperties” service to Disable the fields after updating them in database.
Here’s a closer look at the “SetFieldProperties” service inputs. In this example we are using “SetFieldProperties” to disable the fields after on clicking the save button.
We can right click on fields tab to add multiple fields to set their properties. Once we add a field, we should pass field’s name into “FieldName” input, the property we would like to set into “PropertyName” input, and the value we would like to set into “PropertyValue” input.
We can use the recommended values at the side to help select a field. This list is populated from the fields on the webpart canvas.
Once clicked into the PropertyName, and after a FieldName has been entered, the properties should populate based on the field chosen.
On the left side we have the fields disabled (Grayed out) after the service ran. On the right side we have output logs. In the output we have field name, property name, property value and row index of the field. Notice that we get separate nodes for each of the fields we added in inputs.
Using SetFieldProperties Service to Set Error Message After Validating Login Credentials
In this example, users can turn on the edit mode by logging in with their credentials and clicking the “Turn on edit mode” button. On the page, we have a field for “User Name”, “Password”, and there is another field named “Message”. Initially the “Message” fields’ text is set to blank. In the button process we are validating the credentials using the “Binary Decision” service. If the credentials are wrong and the Binary Decision service fails, we set error message as “Message” fields’ text.
Here’s what the SetFieldProperties service in this process looks like:
Notice that the “Property Value” is a static message. We could have set this to be a variable referencing another service output from the process canvas, but in this case it is not needed.
When we add any field in the SetFieldProperties service, and click on the “PropertyName” input, we can see the properties that we can set using this service under Recommended Values section on the right side. Also, we can drag and drop these into “PropertyName” input area.
In the example above we used a Label field. Therefore we can see all the properties associated with Label field on the right side
This is how it looks on the page once the setFieldProperty runs.