Skip to main content
Question

Help with Dynamic form rules on show/hide fields

  • July 2, 2019
  • 0 replies
  • 51 views

I have 20 date fields, 20 result fields and 10 activity fields. 
There are 2 tables Course and Enrollment
Activity field reside in Course table and Date and result fields in Enrollment. 

I course has many enrollments. Also there is a field 'Number of activities' (multiple choice text with option 1 to 10) in Course table. Each course can have up to 10 activities. When a course is selected in enrollment table , the activity fields should appear in according to the number of activities listed for that course. For example:

Course 1 has 3 activities, then in Enrollment table when course 1 is selected, Activity 1, activity 2 and activity 3 fields should be displayed. I have created 10 dynamic rules as follows: 

When 'number of activities' >=1 show activity 1
When 'number of activities'>=2 show activity 2. 

Problem faced:  When number  of activities = 10 it displays only activity 1 and activity 10. Is there anything wrong with field type or rules? 

Because [Number of Activities] is a text field, your formula compares the values like it compares text... i.e., in alphabetical order, not numerical order.  Consequently, "1" < "10" < "2" < "3", etc.  You might try creating a new formula-numeric field [Number of Activities - numeric] with the formula

ToNumber([Number of Activities])

and set your dynamic formula rules to use it instead of the [Number of Activities] (text) field.