PowerShell in RPA

svrbattula
Giga Contributor

Hi Team,

I am using PowerShell invoke script to execute a API call 

Got output in System.Collections.ObjectModel.Colletion

How can I convert this into string?

1 ACCEPTED SOLUTION

Swathi Pavani1
ServiceNow Employee
ServiceNow Employee

Hi @svrbattula ,

To convert the output from System.Collections.ObjectModel.Collection, you can use the Transform Data option on that component. This feature allows you to modify any data that comes from the Data In port or is returned through the Data Out port.

In RPA Desktop Design Studio, on the Design surface, right-click on either the Data In or Data Out port that you'd like to transform, and then select Transform Data.

In the DATA TRANSFORMATION EDITOR dialog box, enable the option by checking the Enabled checkbox, which will allow you to enter your script in the Script section.

Once this is done, the Data port will turn green, confirming that the data transformation is applied within the automation flow.

You can choose from the following scripting languages to write your code for the data transformation:

  • VB.NET

  • C#

  • JavaScript

In the Script section, you can input your code (for example, Return Value(0).ToString()). The Value variable can be used to reference the incoming data from the Data In port or the outgoing data from the Data Out port.

After writing the code, simply click OK. The system will validate the script, and if there are any errors, they will be displayed in the ERRORS section. Please resolve any issues and click OK again.

 

For a more detailed explanation, you can refer to the following link:
ServiceNow RPA Studio Documentation - Transform Data

 

 

If this resolves your issue, kindly mark this as helpful.

 

 

Thank you!

View solution in original post

3 REPLIES 3

Swathi Pavani1
ServiceNow Employee
ServiceNow Employee

Hi @svrbattula ,

To convert the output from System.Collections.ObjectModel.Collection, you can use the Transform Data option on that component. This feature allows you to modify any data that comes from the Data In port or is returned through the Data Out port.

In RPA Desktop Design Studio, on the Design surface, right-click on either the Data In or Data Out port that you'd like to transform, and then select Transform Data.

In the DATA TRANSFORMATION EDITOR dialog box, enable the option by checking the Enabled checkbox, which will allow you to enter your script in the Script section.

Once this is done, the Data port will turn green, confirming that the data transformation is applied within the automation flow.

You can choose from the following scripting languages to write your code for the data transformation:

  • VB.NET

  • C#

  • JavaScript

In the Script section, you can input your code (for example, Return Value(0).ToString()). The Value variable can be used to reference the incoming data from the Data In port or the outgoing data from the Data Out port.

After writing the code, simply click OK. The system will validate the script, and if there are any errors, they will be displayed in the ERRORS section. Please resolve any issues and click OK again.

 

For a more detailed explanation, you can refer to the following link:
ServiceNow RPA Studio Documentation - Transform Data

 

 

If this resolves your issue, kindly mark this as helpful.

 

 

Thank you!

svrbattula
Giga Contributor

Hi Swathi, thank you 

svrbattula
Giga Contributor

Hi Swathi,

In ServiceNow desktop design studio, I want to automate filling the PDF forms. But I can see it supports for reading text, extracting tables and converting formats.

Is there any possible way to fill up PDF forms?