Dynamic Selector returns error

I’m trying to make a dynamic selector to type into depending on the lines in my datatable. The selector used is as follows where invoiceLineNo will increase by 1 after each loop. The variable returns the correct value to be appended into the selector but it always return an error when the activity is ran. Is there any way to write out the selector for this particular activity during the run cycle so I can check if the full selector is correct or anyone point out where the issue could be? Thanks in advance.

Actual Selector

<webctrl id='ptifrmtgtframe' tag='IFRAME' />
<webctrl id='ACE_$ICField8$0' tableRow='6' tag='TABLE' />
<webctrl id='DERIVED_WORK_BI_LINE_DESCR$0' tableRow='8' tag='INPUT' />

Proposed Selector

<webctrl id='ptifrmtgtframe' tag='IFRAME' />
<webctrl id='ACE_$ICField8$0' tableRow='6' tag='TABLE' />
<webctrl id='DERIVED_WORK_BI_LINE_DESCR$+invoiceLineNo.ToString+' tableRow='8' tag='INPUT' />

If you open the selector in Advanced Editor, it should look like an actual string, with double quotes, for example:

"<webctrl id='ptifrmtgtframe' tag='IFRAME' />
<webctrl id='ACE_$ICField8$0' tableRow='6' tag='TABLE' />
<webctrl id='DERIVED_WORK_BI_LINE_DESCR$+invoiceLineNo.ToString+' tableRow='8' tag='INPUT' />"

If that’s the case, you can try adding additional double quotes, so that it looks like this:

id='DERIVED_WORK_BI_LINE_DESCR$" + invoiceLineNo.ToString + "'

It could be that I’m using a older version there’s no advance editor option. All I see are Indicate on Screen, Edit Selector and Open in UIExplorer.
I’ve also tried placing " both before and after the + but it doesn’t work as well. Have tried the following:

id='DERIVED_WORK_BI_LINE_DESCR$" + invoiceLineNo.ToString + "'
id='DERIVED_WORK_BI_LINE_DESCR$ + "invoiceLineNo.ToString" + '

Even in older versions you should be able to see something like this in the Properties panel:

image

and when clicking on the “+” sign you should see the Advanced Editor option:

image

Otherwise you should be able to select the text you want to replace with a variable (in my case, I selected 2 but kept B:

Then you right click, you choose “select variable” and you choose the variable you want to use instead. It will look like this:

image

Where “strPDFText” is the name of my variable.

Thank you so much it works now following the use variable approach. Just to add on it looks exactly as you said it would with the double quotes in the Advance Editor but it isn’t working.

"<webctrl id='ptifrmtgtframe' tag='IFRAME' />
<webctrl id='ACE_$ICField8$0' tableRow='6' tag='TABLE' />
<webctrl id='DERIVED_WORK_BI_LINE_DESCR$+invoiceLineNo.ToString+' tableRow='8' tag='INPUT' />"
1 Like

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