How to join two fields or split one field into two fields in Planview?
Scenario 1: Joining two fields
To join individual fields in the model, follow these steps:
- Use an Extension: Implement a custom extension to split the joined field back into its original components. Below is a sample extension script:
```javascriptvar inputTypes = ['Rich Text', 'Rich Text'];
var outputTypes = 'Rich Text';function transform(context, input) {
// returns the result of the transformation var output_string = input[0] + '<br />--------------------------<br />Acceptance Criteria :<br />' + input[1] return output_string
}
</li></ol> <p> </p> <ol start="2"><li> Add the Extension: Navigate Settings</li></ol> <p style="padding-left: 40px;"><img src="https://uipath.file.force.com/servlet/rtaImage?eid=ka0Pa000000tf8f&feoid=00N1Q00000Tffpw&refid=0EMPa00000H0kM1"></img></p> <ul><li>Select Extension tab > Click on Manage Extensions.</li></ul> <p style="padding-left: 40px;"><img src="https://uipath.file.force.com/servlet/rtaImage?eid=ka0Pa000000tf8f&feoid=00N1Q00000Tffpw&refid=0EMPa00000H0pK7"></img></p> <ul><li>Here, the extensions can be created or modified, depending on the requirements:</li></ul> <p style="padding-left: 40px;"><img src="https://uipath.file.force.com/servlet/rtaImage?eid=ka0Pa000000tf8f&feoid=00N1Q00000Tffpw&refid=0EMPa00000H0xCn"></img></p> <ul><li>To add a new extension, click on New Extension:</li><li style="list-style-type: none;"> <ul><li>Type the New Extension Name</li><li>Description</li><li>Extension Code</li></ul> </li></ul> <p style="padding-left: 40px;"> </p> <p style="padding-left: 40px;"><img src="https://uipath.file.force.com/servlet/rtaImage?eid=ka0Pa000000tf8f&feoid=00N1Q00000Tffpw&refid=0EMPa00000H0zjF"></img></p> <p> </p> <ol start="3"><li>Test the Solution: After adding the extension, test the functionality to ensure that updates to the original fields are correctly reflected.</li></ol> <p> </p> <ol start="4"><li>Monitor and Adjust: If the extension does not work as expected, adjust the delimiter or logic within the script to match the specific format of the data.</li></ol> <p> </p> <p> </p> <h2><strong>Scenario 2: To update individual fields after joining them in the model and splitting them in two fields, follow these steps:</strong></h2> <ol><li>Use an Extension: Implement a custom extension to split the joined field back into its original components. Below is a sample extension script: <pre class="language-markup" style="background: #efefef;padding: 8px;display: block;border: 1px solid rgb(204, 204, 204);overflow-x: auto;"><code>```javascript var inputTypes = ['Rich Text']; var outputTypes = ['Rich Text']; function transform(context, input) { // Extract the input string var inputString = input[0]; // Define the delimiter (modify based on your format) var delimiter = '<br />--------------------------<br />'; // Split the string into two parts var splitData = inputString.split(delimiter); // Assign default values if the split doesn't work as expected var secondPart = splitData[1] ? 'Acceptance Criteria:<br />' + splitData[1] : ''; // Return an array with two outputs (for two fields in Planview) return secondPart; } ```</code></pre> </li></ol> <p> </p> <ol start="2"><li> Add the Extension: Navigate to the extensions section in Planview Tasktop and add the provided script.</li></ol> <p> </p> <ol start="3"><li>Test the Solution: After adding the extension, test the functionality to ensure that updates to the original fields are correctly reflected.</li></ol> <p> </p> <ol start="4"><li>Monitor and Adjust: If the extension does not work as expected, adjust the delimiter or logic within the script to match the specific format of the data.</li></ol> <p> </p>