Get Text Questions

I want to know how to get the 4th character of a sentence when using get text.

Hi,

How about the following way?

strVar(3).ToString()

Regards,

thank you
but I want to store it in a specific variable rather than the message box.

Hi,

Can you try Assign activity?

img20220114-3

newVar = StrVar(3).ToString()

Regards,

image
please explain in detail

Hi,

Can you share output which you expect?

Regards,

I want to extract only the percentage after the letter and store it in a variable

Hi,

it’s not a forth character… Anyway, can you try the following expression?

newVar = System.Text.RegularExpressions.Regex.Match(strVar,"[.\d]+%").Value

Regards,

I tried to apply the 4th character extraction, but it’s not easy. I tried, but an error occurs

Hi,

I’d like to confirm your requirement.

In the above image, Get Text activity returns 152.35MB(50.78%) , right?

Is what you need just “%” or “50.78%”?
If any other else, can you share it as specific?

Regards,

That’s right I want to extract 50.78 and store it in a variable named getmemory

Hi,

Alright. Can you try the following steps?

First, Put GetText activity and indicate your target element. Set strVar at Value property.
Note : strVar is String type variable.

Next, To check its content of variable, put WriteLine activty and set the variable.
Then, Put Assign activity and expression is the following.

newVar = System.Text.RegularExpressions.Regex.Match(strVar,"[.\d]+(?=%)").Value

Finally, check content of the above result.

If you have any error, please share it.

Regards,

Assign: Value cannot be null.
Option name: input
please this error check

Hi,

Can you check content of variable which is output by GetText activity?
We can see it in OutputPanel by WrteLine activity.

Regards,

Hi
My output panel doesn’t output anything other than the mentioned error

Hi,

I suppose your get text doesnt work correctly. Can you check its settings such as selector?

Or can you share your workflow, if possible?

Regards,

hi

Can you set variable in the following property of GetText?

Regards,

yes i can do it
What should I set it to?

Can you set strVar?

I set it to strVar and it worked. Thank you for your reply.

1 Like