How to check for text already in field

Hi,
I’m developing a small StudioX automation that will open a ticket in Service Now and populate some details based on an email alert from SN.
When I open the ticket I want to first make sure that the data I want to populate in a field isn’t already populated.
I’m using a “Type Into” activity to populate.

Can anyone help me with what activity I should use to see if there is already data in this field any bypass?

Thanks,
John.

hey @johnom
so what you can do is use a get text activity to get text from that field and then use if condition to check something like this
String.output_of_get_text(variable).IsNullOrEmpty that mean if it is empty what actions you want to perform and in else you can keep TypeInto

Please marks as solution if it helps.
cheers,
parth

2 Likes

Hello,

You can basically do what everybody has been doing since UI automation started so long ago, use a “if else” , in your case you would wanna first use the get text on the target element , save it to a value and them use a if-then-else block to test if the text on the target element is empty or not , if empty just write data , if not empty write the equivalent of an empty string and then populate it with the correct data :slight_smile:

Thank you very much @dragos.suma. I’m new to RPA so please have patients with my lack of knowledge :smiley:

Hope it helped :slight_smile: I was unable to provide a workflow as an example because html developers got a few new tricks along the years and what seems to be an input field that has something populated in it could be a bit different when you look it up. For example the default page of Google Chrome

If one just looks at it one could assume that the search box would have a property called text that would be populated with : Search Google or type a URL but in fact is uses the placeholder property to display the text :slight_smile:

So I would recommend that you bring up the developer tools ( if one uses Chrome , same thing for FF but can’t remember the name ) and check if the desired is populated and on which html property.

Hope this helps :slight_smile:
Dragos.

That worked, thanks @dragos.suma

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