How to If there is text in the place I specified, copy text else don’t do anything

Hi I want to this.how can I do ?

If there is text in the place I specified, copy text else don't do anything

1 Like

Hi @sufyant

Use stringText.ToString .Contains(“your text”)

then use Copy Selected text activity or else leave the else

Thanks
Ashwin S

1 Like

Hi. there is no specific text here. there is a field sometimes have text in place but sometimes don’t have. And I want to

if there is text in there, copy text

Hi
is it a UI the place where we search for the text or is it between any string that we pass as value
if its a UI then we can use ELEMENT EXISTS activity and get the output with a variableof type boolean named boolexists
use a IF condition and mention the condition like this
boolexists = True

if true it goes to THEN part where we can use GET TEXT activity and get the output with a variable of type string and pass that string variable asinput to SET TO CLIPBOARD so that its now copied to clipboard which can be later pasted with SEND HOT KEY activity with key as ctrl+v

or

if its like a string we can use condition like this in a IF
stringvariable.Contains(“your value to be found”)

if true it goes to THEN part where again same like above that is passing the stringvariable to SET TO CLIPBOARD so that it will get copied

Cheers @sufyant

1 Like

I am already using ELEMENT EXIST but dont working

1 Like

Fine lets do one thing
use IMAGE EXISTS activity and choose that FIELD WITH NO VALUE as a image
and while running the process while checking whether that field has any value or not use this image exists activity and that would help us to check whether the field has any value or not first, and get the output with a variable of type boolexists

use a IF condition like this
boolexists = True

if true it will go to THEN part or goes to ELSE part
in then we can use GET TEXT activity and get the value in it with a string variable named strinput

now if its like a string we can use condition like this in a IF
stringvariable.Contains(“your value to be found”)

if true it goes to THEN part where again same like above that is passing the stringvariable to SET TO CLIPBOARD so that it will get copied

Cheers @sufyant

1 Like

but the text are differences so if I use the IMAGE EXIST it will not universal right ? and if there is no text, the field becoming invisible

actually we are choosing the field without any value only for IMAGE EXISTS activity and we are doing so to identify whether the field has any value in it or not as a criteria
if it has some value our image exsits will give us boolean variable as FALSE as it has some value in it or as TRUE as it has no value in it
later only we are actually gettng the value in it with GET TEXT activity
@sufyant

1 Like

okay I understand you but if there is no any value in there , the field places going to invisible. so I cant use IMAGE EXIST

Fine then we can choose that field name itself first with IMAGE EXISTS activity and we can check whether it is there or not
Cheers @sufyant

1 Like

How @Palaniyappan

Can i have the image of that field if possible with and without value in it

@sufyant

1 Like

with value

without value

Fine is there any other element or image that comes along with this

if value is there

@sufyant

1 Like

No @Palaniyappan

we can choose this as a image

image

so that it will give us TRUE which means there is no value in it or as FALSE if it has any value in it

is it possible to do that
Cheers @sufyant

1 Like

its impossible because this image every time visible. But I fix it probably (its worked now. I hope it will not get error after now) with ELEMENT EXIST and I change the HTML code in UI Explorer

1 Like

great
yah element exists would work either as we have the attribute like aaname or text or some sub nodes when element actually appear with which we can check whether the text is there or not

@sufyant

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.