Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to add a few new values in an existed field(ListBox) based on a condition that if 1 of them get selected it should select a set of existed field values ?
Ex: 1. I have a field called NAME with values A,B,C,D,E,F (Default values from Database)
2. I wanted to have 2 more values in that field X,Y (Need to include manually) (Finally NAME field with values A,B,C,D,E,F,X,Y)
3. When I select X from this listbox, it should select A,B,C and when i select Y it should select D,E,F
So is it possible to achieve ?
Thanks
I dont think it is possible, instead you may think of having one more field with the value X and Y and can link to specific combination of values of NAME in the script by joining them.
Using inputfield you may change values manually in UI but you would need to add placeholders manually in script -
FromDatabase:
INPUTFIELD Name;
Load RecNo() as Key,Name;
Load * inline [
Name
A
B
C
D
E
F ];
Concatenate
Load RowNo() as Key,* inline [
Name
X
Y ];
Regards,
Hi Mohan, try to use this:
//Load from the source, using load inline as sample
Table:
LOAD * INLINE [
NAME
A
B
C
D
E
F
];
//Loading new values
LOAD * INLINE [
NAME
X
Y
];
Now, in the front end, you need create a variable, I created vSelected.
Go to Settings - Document Properties - Triggers tab, on Field Event Triggers section, select NAME field and then click on Add Action(s) button on 'OnSelect' type.
Add a new external action, Set Variable, and put the next:
Variable box: vSelected
Value box: =GetFieldSelections(NAME,',')
For this specific feature that you need, you must apply actions, so, create a new button object and add the next action:
Select in Field action on Action Type: Selection. Put the next:
Field box: NAME
Searching String: =if('$(vSelected)' = 'X','('&Replace('A,B,C',',','*|*')&')', if('$(vSelected)' = 'Y','('&Replace('D,E,F',',','*|*')&')',vSelected))
Now, create a listbox object, using the NAME field and select X or Y value, then click on your new button and see the result.
Regards,
Enrique.