Skip Ribbon Commands
Skip to main content
SharePoint

Find and Replace Data Item Tokens in a Text File Template

You can search for specific data item tokens and replace it with the value of the solution or process data item from the process. You need to have a text file configured as a document template in your solution before you can successfully configure this activity.

The token needs to be in the form of Solution.DataItems.<data item name> or Process.DataItems.<data item Name>, so the Process Engine can match values correctly. If your data item references a data model, then you will need to include the data model element in your token.

An example solution data item token with a data model is Solution.DataItems.Employee.Name.FirstName, where the Employee data item references a data model with a Name group element containing a FirstName input field element.

To find and replace data item tokens in a text file template, complete the following steps:
  1. Check out and open the process you want to edit.

  2. In the Toolbox pane, click Document. A list of activities is displayed.

  3. Double-click or drag the Write Text File activity into the process.

  4. Link the activity appropriately with other activities.

  5. Right-click the Write Text File activity. A shortcut menu is displayed.

  6. Select View Properties. The Write Text File window is displayed.

  7. Click the File Options tab, The corresponding screen is displayed.

  8. Select the Find and Replace Tokens in a Plain Text Templates option.

  9. In the Template field, click the Document Template editor. A drop-down list is displayed.

    Note:
    The Document Template editor is selected by default. You can also select the Data Item editor to select a data item that sets the field to a value that is a document template.


  10. Select the document template in which you want to find and replace the data item token.

  11. Click the Output Destination tab. The corresponding screen is displayed.

  12. In the File Encoding field, click the drop-down arrow. A drop-down list is displayed.

  13. Select ASCII or UTF-8.

    Note:
    You select ASCII or UTF-8 depending on your platform and locale.


  14. In the Output File Name field, select the appropriate input field editor and set the field to a value that is a file name.

  15. From the If the file already exists section, select Overwrite the file or Increment the file name.

    Note:
    Select Overwrite the file to replace the existing file. Select Increment the file name to save the updated version of the existing file.


  16. In the Output File Location field, select the appropriate input field editor and set the field to a value that is a file location on your system.

  17. In the Authentication section, select the Run as BPM Server or Specify credentials option.

    Note:
    If you select Run as BPM Server, access will be granted or rejected based on the BPM Server credentials. If you select Specify credentials, complete the Username, Password, and Include domain fields using the appropriate input field editors. The Include domain check box is optional.


  18. Click OK. You configured the activity to find and replace data item tokens in a text file template.
Related Topics
Write Data Item Values to a Delimited Text File
Write All Solution and Process Data Item Values to a Text File

Source
BPM Designer Topics > Overview of Activities and Activity Topics > Document Activities > Write Text File
Last modified at 7/31/2020 11:35 AM