HtmlWorkshop

HtmlWorkshop

SetFieldProperties Overview

The service “SetFieldProperties” is used to set or update properties of the any field. This could be accomplished by determining the value in a datasource and dynamically setting the field from the field on the webpart canvas, but it can be helpful to this in a process canvas and with the SetFieldProperties service since it gives you access to a process canvas before setting the property. This service can be used where we are required to hide fields, change CSS, change verbiage, etc. A single SetFieldProperties service can set multiple field properties by adding additional fields.

SetFieldProperties with Child WebParts

In this example we have two child webparts “WebPart’” and “WebPart1” with fields Name, Email and phone in both of them. In the “SetUsers” button we have a process which uses the service “SetFieldProperties” to set the field values in child webparts. Here’s a closer look at the service inputs.

Note: If the input “WebPartId” is left blank, the service looks for the field in the main webpart and sets the property.

SetFieldProperties with a List Section

SetFieldProperties has an input called RowIndex which allows us to target specific row in a list section to set its property. If there is a list section and a specific line on that list section needs a value changed, that can be accomplished by finding out the row index of the desired line. EASYProcess List Section Rows index starts at 0.

If the row index is left blank and the field we are trying to set is in a list section, by default the service sets value to all the rows.

Row Index

This feature can be used for more complex examples, but below we are going to create a test list section and using this feature change a value on the desired row.

In this example we have created a list section of users for the site. Above the list section is a text box where we can type the row we wish to target. We will be changing the “Active” column to either “Yes” or “No” by selecting a value from the radio button.

The row number entered corresponds to a row in the list section. Clicking the “Set User” button targets that row of the list section and changes the “Active/Inactive” status of the row. Here is the process canvas for this action:

If we take a closer look at the SetFieldProperties service configuration, you can see the inputs which are accomplishing this.

Since EASYProcess List Section Rows index starts at 0, the first row is represented by 0. We are using “$EP_Field_Row - 1” to target the correct row. If we want to change the second row, the user will type in “2”. The button process will take the “2” and subtract 1 to give us the value “1”. The 1 row index will then target the second row in the list section.

If the row index were left blank, since the field we are trying to set property is in a list section, by default the service sets value to all the rows.

When we type in the value “1”, the our button process will set the value in the first row with index “0”. Here are the SetFieldProperties service logs for this:

Notice that we have left the input “WebpartId” blank and we can see that it defaults to the webpartId of the Webpart from which we’re running this service.