BioloMICS logo
×
BioloMICS Web Menu

Dynamic deposit form with 2 criteria

 
 
It is possible to allow users to deposit data from the website.
 
Depending on the result of 2 given field, other field(s) can be added to the deposit form.
 
 
A specific example is used here to explain the procedure:
 
 
 
 
As shown in the gif-movie above, 2 dropdown fields called "Species" and "Sex" are used to decide which extra fields should be added to the deposit form.
 
 

In short:

 
  • Build the needed System query templates. This is the dynamic field and it's possible options.
  • Create Form action templates for each System query template made. One if query result is true.
  • Create a Form template, or Stepper form template, and place the dynamic field to the form as well as all the fields that are present in the Form action templates.
  • Activate the trigger in the (stepper) form by selecting the system queries and matching form action templates.
  • Create a Page and drag the (stepper) form onto it. Link a web layout to the page.
  • Optional: In the Menu, add a link to the dashboard page.
 
 
 

Full instruction:

 
  • Create a System query template and add the field(s) and the condition(s) that should be used as indicator to show another set of fields or not.
     
  • In this example the 2 dropdown fields are used as indicator.
     
  • Species: This field has, in this example 2 options to choose from. Note that the option unknown is the default state.
  • Sex: This field has, in this example 2 options to choose from. Note that the option unknown is the default state.

     
  • For each combination of options a separate System query template needs to be created.
  • Cattle - Male
  • Cattle - Femal
  • Dog - Male
  • Dog - Female
     
  • Drag the fields "Species" and "Sex" to the System query and set the query for the wanted option.

     
  • For each system query template, the the different combinations are covered.
     
  • System query Cattle - Male:

     
  • System query Cattle - Female:

     
  • System query Dog - Male:

     
  • System query Dog - Female:

     
  • Create a Form action template for each System query template made.

    The form action template contains the all the extra fields that should appear on the deposit form when the given Species/Sex combination is selected by the depositor.

    Note that also the fields that are not part of the current combination need to be added, however they can be set as invisible and disabled.

    In this example, this is what we plan:
  • Cattle-Male: Show the link field "Father SireID", and filter linked records to display only Cattle-Male records.
  • Cattle-Female: Show link field "Mother DamID", and filter linked records to display only Cattle-Female records.
  • Dog-Male: Show remarks field with note "Remarks Male Dog"
  • Dog-Female: Show (the same) remarks field with note "Remarks Female Dog"
     
  • For each of the 4 System query templates made (in step 1), 1 form action template has to be created.
     
  • As an example we show here the Form action Catte - Male - Yes.
     
  • Drag all the fields that should be displayed in the deposit form regardless the selected combination.

     
  • In the properties of the form action set the right properties for each field.
    In this example, we are in the Form action Catte - Male - Yes, so only the Father field will be enabled and visible
  • Select an option: Check Enabled (!) and Visible (!)
        
  • Enabled (!): check this option.
  • Visible (!): check this option.
        
     
     
    The autocomplete and Search term length are, in this example, also added to the "Select an option" and the System query is given in the Autocomplete section.

     
    3. For all the other fields, that are not doing anything when the combination Cattle-Male is selected, uncheck Enabled and Visible.
    So here, these steps are to be done for the Mother field and the remarks field.

     
    In "Select an option", they should both be checked.

     

    Repeat this step for each of the cominations.
     
    Note that for the Remarks field, if the placeholder and field name need to be adapted depending if it is Male or Female, then also check them in the "Select an option section".


     
    In the end there are 4 Form action templates created.
    1. Form action Cattle - Male - Yes
    2. Form action Cattle - Female - Yes
    3. Form action Dog - Male - Yes
    4. Form action Dog - Female - Yes
     
  • Create a Form template, or Stepper form template.
     
  • Drag the wanted fields onto the form, including the dynamic fields (Father, Mother and Remarks).
     
  • In the Properties - general options make sure that for the fields that should always be present, the following options are checked.

     
  • For the dynamic fields, make then disabled and invisible by default.
     


     
  • In the Properties of the (stepper) form, in the Trigger options, select the System queries and the matching Form action templates (only Yes is sufficient in this case).

        

     
  • Create a Page and drag the (stepper) form onto it.
     
  • In the Properties - Global options, link a web layout to the page.


     
  • Optional: In the Menu, select the deposit page from the Other Links section on the left.