ga('set', 'anonymizeIp', 1);

[Blue Prism] Copy Collection Rows to Windows Clipboard

Share

RPA: Add code stage to copy collection rows to windows clipboard in Blue Prism.

Environment Setting

Go to Initialse tab in the object.

Double click the initial block in initial tab.

In "Business Object Properties", switch to "Code Options" tab.
Add the External References and Namespace Imports as the following image.

Code Stage

In the object, drag a new [Code] stage.

Inputs column

The inputs variables:

Outputs column

The outputs variables:

Code

Try
    Dim StrBuilder As New StringBuilder
    If Start_Row < 0 Then
        Throw New ApplicationException("Start Row must be at least zero.")
    End If
    Dim LastIndex As Integer = Source_Collection.Rows.Count-1
    If Start_Row > LastIndex Then
        Throw New ApplicationException("Start Row must not beyond the end of the collection.")
    End If
    If Start_Row + Number_of_Rows_to_Copy - 1 > LastIndex Then
        Throw New ApplicationException("The number of requested rows extends beyond the end of the collection." & Start_Row.ToString() & Number_of_Rows_to_Copy.ToString() & LastIndex.ToString())
    End If

    'Set up the new collection with columns
    'For J As Integer = 0 To Source_Collection.Columns.Count - 1
    '  Output_Collection.Columns.Add(Source_Collection.Columns(J))
    'Next
    'Output_Collection.Columns.Add(Source_Collection.Columns(0))

    'copy the requested rows on by one
    For I As Integer = Start_Row To Start_Row + Number_of_Rows_to_Copy - 1
        Dim Values(Source_Collection.Columns.Count - 1) As Object
        'For J As Integer = 0 To Source_Collection.Columns.Count - 1   
            Values(0) = Source_Collection.Rows(I)(0)
            'strBuilder.Append(Values(0) & Chr(9))
            strBuilder.Append(Values(0))
        'Next

        'Output_Collection.Rows.Add(Values)
        strBuilder.AppendLine()
    Next

    Clipboard.SetDataObject(StrBuilder.ToString, True)
    Success = True
Catch Ex As Exception
    Success = False
Jys

Published by
Jys

Recent Posts

[python] Flask Create RESTful API

This article gi... Read More

3 年 前發表

[Javascript] 新增/刪除JSON中key值

在web訊息交換常會需要對JS... Read More

3 年 前發表

[JAVA] SQL Server Connection

本文介紹JAVA連線SQL s... Read More

3 年 前發表