UiPath.Word.Activities.WordInsertDataTable
Description
Inserts a table generated from a DataTable
variable in a Word document. The table is created at a position relative to a specified text or bookmark. This activity can only be used within a Word Application Scope activity.
Properties
Common
- DisplayName - The display name of the activity.
Input
- DataTable - The
DataTable
variable you want to create the table from. This field supports onlyDataTable
variables.
Insert Options
- Bookmark - The name of the bookmark which specifies the position where you want to insert the table. This field supports only strings and String variables.
Important!
The value inserted in the Bookmark field cannot be longer than 40 characters.
- Occurrence - Specifies which occurrence of the target element to be used as the position for the table. The following options are available: All - the table is inserted at each occurrence of the element, First - the table is inserted at the first occurrence of the element, Last - the table is inserted at the last occurrence of the element, Specific - the table is inserted at the occurrence of the element specified in the OccurrenceIndex property.
- OccurrenceIndex - Specifies the occurrence of the target element where you want to insert the table as an
Int32
variable. This property field is taken into account only if the Occurrence property is set to Specific. This field supports onlyInt32
variables. - Position - Specifies the position relative to the target element where you want to insert the table. The following options are available: Start - at the start of the document, End - at the end of the document, Before - before the target element, After - after the target element, Replace - the target element is replaced with the table.
- Text - The text which specifies the position where you want to insert the table. This field supports only strings and String variables.
Important!
The value inserted in the Text field cannot be longer than 256 characters.
Misc
- Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
Example of Using the Insert DataTable Activity
To exemplify how to use this activity, we have built an automation project which offers three different cases in which you can use this activity:
- The table is retrieved from a Build Datatable activity and inserted at the beginning of the document
- The table is retrieved from an Excel workbook and inserted after the first occurrence of a specified text.
- The table is retrieved from a Build Datatable activity and replaces the third occurrence of a specific text.
You can download the workflow here.
UiPath.Word.Activities.WordInsertDataTable
Description
Copies a range from Excel or saved for later table data and inserts it as a table in a Word document at a specified position relative to a text or bookmark. This activity must be added inside a Use Word File activity.
To learn how to use this activity, see Tutorial: Working with Word Automation.
Configuring the Activity
In the Body of the Activity
- Table to insert - Click Plus
next to the field, select the Project Notebook or a parent Excel file, and then a range, table, or sheet to insert in the Word document, or click Indicate in Excel to select a range directly from the file. Alternatively, you can select Open in Advanced Editor and enter a VB expression.
To Insert the Table at the Start or at the End of the Document
- Insert relative to - Select Document.
- Position where to insert - Select the position in the document where to insert the table: at the Start or at the End of the document.
To Insert the Table Relative to a Specific Bookmark in the Document
- Insert relative to - Select Bookmark.
- Bookmark to search for - Click Plus
on the right side of the field, and then, from the menu, select Text to enter the name of the bookmark relative to which to add the table in the Text Builder. Alternatively, choose one of the other available options in menu to indicate the bookmark name:
- Data from the Project Notebook, a parent Excel file or Outlook account. For example, select an Excel file and then select a cell that contains the bookmark name, or indicate a field from a selected email in Outlook that contains the name.
- Use Saved Value - Select a value that you previously saved for later use in the project.
- Ask when run - Prompt for the bookmark name when the project is executed.
- Open in Advanced Editor - Enter a VB expression.
Important!
The Bookmark to search for value cannot be longer than 40 characters.
- Text occurrence - Select All to insert the table relative to every occurrence of the bookmark name.
- Position where to insert - Select the position where to insert the table: Before, After, or in place of (Replace) the specified bookmark.
To Insert the Table Relative to a Specific Text in the Document
- Insert relative to - Select Text.
- Text to search for - Click Plus
on the right side of the field, and then, from the menu, select Text to enter the text relative to which to add the table in the Text Builder. Alternatively, choose one of the other available options in menu to indicate the text:
- Data from the Project Notebook, a parent Excel file or Outlook account. For example, select an Excel file and then select a cell that contains the text to add, or indicate a field from a selected email in Outlook that contains the text.
- Use Saved Value - Select a value that you previously saved for later use in the project.
- Ask when run - Prompt for the text to add when the project is executed.
- Open in Advanced Editor - Enter a VB expression.
Important!
The Text to search for value cannot be longer than 256 characters.
- Text occurrence - Select the occurrences of the specified text relative to which to insert the table:
- All - Insert the table relative to every occurrence of the text.
- First - Insert the table relative to the first occurrence of the text.
- Last - Insert the table relative to the last occurrence of the text.
- Specific - Insert the table relative to a specific occurrence of the text.
To indicate the occurrence, select Plus
next to the Occurrence index field, and then select Number. For example, if the text to search for appears five times in the document and you want to insert the table after the second occurrence of the text, the Occurrence index should be set to
2
.
- Position where to insert - Select the position where to insert the table: Before, After, or in place of (Replace) the specified text.
In the Properties Panel
Common
- DisplayName - The name displayed for the activity in the Designer panel.
Input
- DataTable - See Table to insert in the body of the activity.
Insert Options
- Bookmark - See Bookmark to search for in the body of the activity.
- Occurrence - See Text occurrence in the body of the activity.
- OccurrenceIndex - See Text occurrence > Specific in the body of the activity.
- Position - See Position to insert in the body of the activity.
- Text - See Text to search for in the body of the activity.
Misc
- Private - If selected, the data used in the activity is not logged by StudioX.
Updated 2 months ago