Split multiple string and using "type into" activity

I have scraped information off a website and sent to a txt file. The reason for doing this is because studio only sees one selector for all the info on the website and the txt file so i can’t use the screen scrape activity for each line. Here is an example of the text i scraped:
image
I need to be able to extract the information to the right of the colon on each line and use the “type into” activity to find the information in a dropdown box on another website where I am provisioning access. Any suggestions on splitting this string would be helpful.

Iterate over the matches yielded from the following expression:

System.Text.RegularExpressions.Regex.Matches(MyText, "(?<=:\s).*$")

where MyText is your full text value. If you iterate over type System.Text.RegularExpressions.MatchCollection, each match Item has a value which can be retrieved using Item.Value.

1 Like

Does this expression need to be done in a certain activity in Studio?

You can use assign activities to create the variables. That will be all you’ll need. Just make sure your datatypes are set correctly.

is there any way you could give one specific example of using “assign?” i’m a little familiar with studio but more unfamiliar with coding. thanks

The variable name goes on the left, and the value goes on the right. The value on the right will be exacly what I’ve provided, and the variable will be named whatever you call it when you create it.

i keep getting this error. i’ve tried converting to string and generic value. i’ve made sure the Role variable is included in the flowchart.

You should pass the string you’ve fetched from the text file to the argument on the right in place of where you’ve put the variable Role. The argument on the left should be a different variable set to datatype System.Text.RegularExpressions.MatchCollection, not UiPath.Core.GenericValue.

Hello, I am working on the same project with deaser59, and I think I’ve set my variables as you’ve described.

However, I’m trying to preview one of these assignments using a message box (in order to verify that they’ve been assigned correctly), but I can’t seem to get this value in a usable format. If possible, could you let me know what step I’m missing?

Thanks