Combining Multiple Attributes in a Get Attribute Activity

Hi,
I would like to know whether it is possible to combine two or more attributes in the INPUT field of a “Get Attribute” activity. For instance, I want to print out the name of Microsoft Word document (say “RPA for Beginners”) together with the app name (Microsoft Word). So in the end, I want the Message Box to display something like " RPA for Beginners - Microsoft Word".

Below is the workflow:

@nanayaa
Give a try If IT serves your needs
Uielementvar.Get(yourattributename) and concat IT with the next one

@ppr: I tried but getting the error message below. I believe I am doing something wrong as far as the arguments are concerned:
the UiElementVar is “TestingFindEle”. So what I did was in the Attribute field of the Get Attribute activity, I wrote: TestingFindEle.Get(“name” + “title”)

1 Like

Hi @nanayaa,

You can do something like that . TestingFindEle.Get(“name”) store it in variable var1 then TestingFindEle.Get(“title”) store it in variable var2. Then do this in Message box var1+ " "+var2.
You will get what you need.

Best!!
Anmol

@anmolk171
I guess this means I have to use two “Get Attribute Activities”?

@nanayaa - Yes. Because you can’t target two different element using one selector(If this is possible then it will contradict the basic use of element i.e to find the unique element).

@ppr and @anmolk171
Thank you very much. I used two Get Attribute activities and it is working

2 Likes

@nanayaa
With a find Element retrieve the uielement
Lets assume the var Name is testingfindele

TestingFindEle.Get(“name” + “title”) Here ist the issue

TestingFindEle.Get(“name”) + " - " + TestingFindEle.Get(“title”) would be Statement that should Work. Just for your further upcoming works

Hi Peter,
Below is the error message I get when I use the function:
image

Please how can I turn the Option Strict off if possible?

If I use TestingFindEle.Get(“name”), that does not give any error meaning indeed the + sign being used to concatenate is the issue here.

Use TestingFindEle.Get(“name”).tostring + " - " + TestingFindEle.Get(“title”).tostring

@Pentti_Ristioja
Great. It worked.

Thank you to all

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