Help with Dynamic form rules on show/hide fields

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
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? 
Photo of Raj Helaiya

Raj Helaiya

  • 1,550 Points 1k badge 2x thumb

Posted 2 months ago

  • 0
  • 1
Photo of deldridg

deldridg

  • 262 Points 250 badge 2x thumb

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.

Photo of Raj Helaiya

Raj Helaiya

  • 1,550 Points 1k badge 2x thumb
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. 
Photo of deldridg

deldridg

  • 262 Points 250 badge 2x thumb
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.
Photo of Raj Helaiya

Raj Helaiya

  • 1,550 Points 1k badge 2x thumb
No of activities is a formula numeric field
Photo of deldridg

deldridg

  • 262 Points 250 badge 2x thumb
Please show me the formula you used for [No of Activities], and also a screenshot of one of the form rules that isn't working... like the one for [Course - No of Activities] >= 3.
Photo of Raj Helaiya

Raj Helaiya

  • 1,550 Points 1k badge 2x thumb
This is the formula I used to convert. It is a formula numeric type. 
Photo of Raj Helaiya

Raj Helaiya

  • 1,550 Points 1k badge 2x thumb
also the dynamic formula mentioned above is the one which is not working
Photo of deldridg

deldridg

  • 262 Points 250 badge 2x thumb
Do your other rules work?  Do they look like these?



Set up this way, when I have a Course where [Course - Number of Activities] = 4, I see this:

Photo of deldridg

deldridg

  • 262 Points 250 badge 2x thumb
Notice that each field appears in only one rule.  If a field is affected by more than one rule, then the latter rule will "overrule" the earlier one(s).
Photo of Raj Helaiya

Raj Helaiya

  • 1,550 Points 1k badge 2x thumb
Changing all rules did the job. Thanks
Photo of deldridg

deldridg

  • 262 Points 250 badge 2x thumb
Glad to help!