Dynamic property question

I have a two drop down boxes. The one, we will call screen select, has a fixed number of items. It can only have a value of 1, 2, or 3. The other, we will call mechanic select, drop down box has a query that runs off of a database.

Under the mechanic select I have a dynamic property which is set to string. When the value of screen select is 3, I want this dynamic proper to be part of a where clause. The where clause will be “where mech1 =” and then it will pick up the string value from the mechanic select drop down and finish filling in the query. If the value of screen select is anything other than 3, then the string is null.

The code I have written so far:

if(root container.dropdown.selectedValue=3,"where mech1 = 12345","")

I can not seem to recall the correct way to have the value filled in. I did try:

if(root container.dropdown.selectedValue=3,"where mech1 = %s"%{then the path to the string of the mechanic drop down sting value},"")

Also tried it with %d. Then I tried it without using a path and having the percent equal the value. But again I missing something simple. Can you please help.

Thank you.

You’re missing curly quotes around the path in the if… try this:

if({root container.dropdown.selectedValue}=3, "where mech1 = "+{path to the string of the mechanic drop down sting value}, "" )