Home > For Designers > Design Patterns > Combine Fields for Reporting

Combine Fields for Reporting

Goal 

As is typical when entering data in a form, there is one field for street address, another for state, and so on. But when running a report, it is often desirable to see all of that information concatenated into a single field, rather than having it appear in multiple columns, each of which adds a degree of dead space to that row of the report.

 

In another scenario, perhaps that claims are sometimes assigned to internal adjustors, and sometimes to external agencies. A field of type User would be used to link to the name and contact information for an internal adjustor, while a Smart Object field would be used to link to the name and contact information for a local database of standard agencies. On occasion, it might even be necessary to use an agency that is not already present in the Smart Object database. For those occasions, a Text field would be used to record the name of agency. Each of those fields serves an important purpose, so they all need to be present in the stream. But when running a report, it would be desirable to have a single column that displays the name of the adjustor or agency to which the claim was assigned--rather than three columns, two of which would always be empty.

Solution

The solution  is to create a data component that is used specifically for reporting, In fact, "Reporting" is a good name for the component.

For the first scenario, that component can have an address field, and the process definition can have an Update Fields step that uses an expression to concatenate the address values into a single string. In the second scenario, that component would have an assigned-to field that names the person or external agency the claim was assigned to. To put the correct value in that field, the process definition

would use a Conditional Actions step that fills in the assigned-to value from the User record, the Smart Object record, or the Other field, as appropriate.