Question

5
Replies
805
Views
JessicaV8159 Member since 2019 7 posts
NA
Posted: 1 year ago
Last activity: 1 year 7 months ago
Closed
Solved

Combine two strings from user input from Windows Form

Hi,

I am stuck on a portion of my automation workflow where I am combining two strings to create a file path. The first string/portion of the file path is static ("C:\Users\Name\"). The second string is dynamic and is the desired file name that is input into a text box on a Windows Form by the user. My desired outcome is to combine the two strings and output the complete file path ("C:\Users\Name\FileName.txt") into another text box on the Windows Form. I have attempted to do this by creating a script construct (see example code below), but am getting errors now that the user-friendly script constructs window has been removed from Pega Robotics Studio. Is there an easier way to accomplish this?

Example code:

public sealed class Script
{
public string FullPathName()
{
string txtFileName = Console.ReadLine();
string[] paths = {@"C:\Users\Name\", txtFileName, ".txt"};
string txtPathName = Path.Combine(paths);
return txtPathName;
}
}
Low-Code App Development Testing Applications Robotic Process Automation Low-Code App Development Upgrades
Moderation Team has archived post
Share this page LinkedIn