I want to achieve cascade select in a table.
There are two dropdown in the table row.
The selected value of the first dropdown will be the input variable of second dropdown's query.
e.g. The first dropdown is country list. The second dropdown is city list.
In second dropdown:
I know it is able to pass the variable with the "Report/Plug-in Variables".
I know it is able to use the "_val" to get the current dropdown value.
But how to get the first dropdown value?
It returns an array of the selected values (Because if the dropdown is set to multi, you can select more than one ).
Since it returns an array, you need to access the first array item.
In the properties of your second dropdown, write (assuming the variable in your report object is called country) :
In the properties of your first dropdown, write :
You need to create a function to call on the onChange event on the first dropdown. Add this to your script :
firstDropdown__onChange : function()
var selectedValue = ca_fdGetSelectedOptionValues(ca_fd.formId,'firstDropdown_id');
if(typeof selectedValue != "undefined" && selectedValue != "")
Thanks for reply.
Your solution is for the cascade dropdowns 'outside' the table.
When inside the table, it still work if there is only one editing row.
But it doesn't work when there are more than one row in 'editing mode'. (attached screen)
Do you know how to get the current row number in the onchange event?
Or do you know how to limit the user to only edit one row in table at the same time?
You are right i totally missed the question here
Was the information provided by pier-olivier.tremblay helpful?
pier-olivier 's answer is for "cascade select in form". Not the solution to "cascade select in table".
I think it's better to un-mark the "correct answer" flag, to avoid misleading others..
To sum up, to build "cascade select in form", please refer to pier-olivier's solution.
It seems there is no safe way to achieve "cascade select in table" in SC 17.1
So we will reject this requirement to the end user.
As a workaround, we provide below table to combine all the "cascade select dropdowns" into one dropdown.
In this single dropdown, user can type the keyword to search. So the selection time per row is actually faster than selecting three dropdowns one-by-one.