April 27, 20214 yr Newbies Hi All, I have simple layout with a value list. This is a conditional value list that is changed based on a selection in the preceding field. I basically want to create a simple "Next" button to go to the next value in a Value List and I can't think of a way to do this. I am playing with GetValue and ValueListItems but can't find a way to assess the current value of the field and then add a +1 to go to the next value. Any guidance would be greatly appreciated.
April 27, 20214 yr This is a little difficult to understand. If (as it seems) you have a field formatted as a drop-down list (or a pop-up menu), and you want to calculate the value that is next in the value list relative to the currently selected value, you could do something like: Let ( [ listOfValues = ValueListItems ( "" ; "YourValueList" ) ; i = ValueCount ( Left ( listOfValues ; Position ( ¶ & listOfValues & ¶ ; ¶ & YourField & ¶ ; 1 ; 1 ) ) ) ] ; GetValue ( listOfValues ; i + 1 ) ) Note that if YourField is empty or contains a value that is not in the value list, the result will be the 1st value in the value list. If YourField contains the last value in the value list, the result will be empty. If you prefer, this behavior can be changed to cycling over the value list by changing the last line to: GetValue ( listOfValues ; Mod ( i ; ValueCount ( listOfValues ) ) + 1 )
April 27, 20214 yr Author Newbies Yes, this is exactly what I needed. Works wonderfully! Thank you so much for taking time to write this!
Create an account or sign in to comment