Forum Discussion

RajHelaiya's avatar
RajHelaiya
Qrew Captain
7 years ago

Help with Dynamic form rules on show/hide fields

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? 

13 Replies

  • 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.

    • RajHelaiya's avatar
      RajHelaiya
      Qrew Captain
      Hello, I tried using a fIt still shows activity 1 and activity 10 when number of activities is 10. Doesn't display activity 2 to 9. 
    • deldridgdeldrid's avatar
      deldridgdeldrid
      Qrew Trainee
      Are you certain you adjusted all of the dynamic form rules to use the new field?  Please show me the formula you used for the new field.
    • RajHelaiya's avatar
      RajHelaiya
      Qrew Captain
      No of activities is a formula numeric field