Assigning variable to selector - Peoplesoft

Hi Everyone,

I am trying to perfom the following :

In peoplesoft, I have to open multiple file and the selector is the following, I can see that it work for the “86” by clicking on run.

<html title='Mon libre-service' />
<webctrl id='PAY_END_DT_ALT$86' tag='A' />

Now, I want to iterate the “86” from 1 to 100, for now, I tried to to assign to “variable1” a value of 1 and them assign to “variable2” the following : “PAY_END_DT_ALT$”+variable1.ToString

Them, I use “variable2” in my selector as the following :

 <html title='Mon libre-service' />
<webctrl id='&quot;+variable2+&quot;' tag='A' />

*The application keeps converting the " by &quot, I don’t know if it can cause the error.

When I am running the workflow, it doesn’t seem to work, it block at the selector where it doesn’t recognise the string.

I tried all the solutions proposed in other topics but didn’t work.

Thank you!

Hi @kevent,

It is quite intuitive when you consider the selector as one long string:
“< html title=‘Mon libre-service’ />< webctrl id=‘PAY_END_DT_ALT$86’ tag=‘A’ />”

As you can see, it is enclosed by two quotes.
You can get it if you copy the selector directly without opening the selector menu:

All you need to do is to inject your variable as you would in the standard log message:
"This sentence logs the value of: " + variable1 + “.”
This sentence logs the value of: 2.

Now, for your example, it would work like that:
“< html title=‘Mon libre-service’ />< webctrl id='PAY_END_DT_ALT$”+variable1.ToString+"’ tag=‘A’ />"

Just make sure to paste this selector directly as a string into the field, without opening the menu. It works if your Expression editor for selector looks like this:

Thank Loginerror,

I tried what you explained
See image 1

and I an geeting this error :
See image 2

Also, before you told me to pu the expression my editor was looking like this but I was able to change it to the same than you :
See image 3

I also tried to take your expression in my expression editor but it changes the quotation mark and it gives the following error :
See image 4-5

When I manually force it in the right box, it gives me this error :
See image 6

Thank you !

Image 1

Image 2

Image 3

Image 4

Image 5

Image 6

The last screenshot looks really promising, the validation error is because you need to convert the int variable .ToString. With that it shouls hopefully work.

Assign variable1;
Assign A="< html title=‘Mon libre-service’ />< webctrl id='PAY_END_DT_ALT$”+variable1.ToString+"’ tag=‘A’ />"

pass A value into the selector field , then it works fine

directly passing the variable into selector will not work/variable value will not pass

The method certainly works, see attached xaml file with a simple example with Notepad (if you want to fully test it, you need to create a test1.txt file)

Selector_variable.xaml (5.1 KB)