Use the GetPart component
Get the value of a part of the date format by using the GetPart component in RPA Desktop Design Studio. For example, you might want to get the value of the month in the MM/DD/YYYY format.
Before you begin
Role required: none
About this task
You can configure the properties for the GetPart component. For more information about these properties, see Properties of the DateTime components.
Procedure
In the Toolbox pane, navigate to Utilities > DateTime.
Drag the GetPart component to the Design surface.
To configure the input fields, see Configure port properties.
Connect the data and control ports of the GetPart component to the corresponding ports of the other components as described in the following table.
| Port name | Purpose of connection | Port type | Data type |
|---|---|---|---|
| SourceDate | Passes the date and time for which you want to view the part, from a previously executed component.Drag the Now component from DateTime to get today's date as the source date. For example, if the source date is 01-Feb-2025. | Data In | DateTime |
| Format | Passes the part of the date and format that the value of which is returned, from a previously executed component.For example, enter `MMM`. | Data In | String |
| Return | Returns the value of the part of the date format.If the format is MMM, the output is Feb. | Data Out | String |
- To test the component, under the DESIGN tab, click Run.
GetPart component with Now component
Image omitted: getpart-datetime-rpa.png
GetPart component gets a part of the date using Now component as the source date.
GetPart component gets a part of the date using Now component as the source date.
Parent Topic:DateTime