Count strings of multiple fields

  • jagarolik
    Asked on October 6, 2021 at 1:06 PM

    Hello,

    I have a form with hundreds of fields, all with the same options, which is used for an attendance sheet. This is for a fire department, so we have a field for every firefighter and then 12 check boxes to indicate which truck the firefighter was on.

    For example:

    John Doe: Engine 1, Engine 2, Engine 3, Engine 4, Engine 5

    Jane Doe: Engine 1, Engine 2, Engine 3, Engine 4, Engine 5

    ... etc.

    At the end of the form, I am hoping to display the results for validation. By producing the results of all of the firefighters who are on a given truck.

    As a result, I'm trying to make it so that the form checks for all instances of, for example, "Engine 1" and then produces a list of all the fields where Engine 1 is selected. The preferred result of this would be something like:

    "Engine 1: John Doe, Jane Doe"

    How can I make this work?

    Thanks

  • Alexander_G
    Replied on October 6, 2021 at 3:01 PM

    Greetings, 👋

    Thanks for contacting us.


    Please, allow us some time to prepare the answer for you. We are already working on it.

    Soon we will reply to you,


    Alex

  • Alexander_G
    Replied on October 6, 2021 at 3:39 PM

    Hi there,

    Thanks for your patience.


    You can achieve that by changing the type of field for your firefighters to the input table.

    Then, you may add the calculation values for every firefighter for every input:

    1633548858 615dfa3a882e1  Screenshot 10

    After that - you will have to add conditions for every engine that includes every name:

    1633548936 615dfa887e318  Screenshot 21

    When you select the table inputs - please, select the whole names for the preferred engine:

    1633548976 615dfab09f202 Screenshot 2021 Screenshot 32

    After that, once the firefighter selects the engine - it shows in the field:

    1633549035 615dfaebba3a4 screencast 2021 Screenshot 43

    Here's a demo form for you: 👉 https://form.jotform.com/212786170837059

    You can clone it and play with it: 👉 How to Clone an Existing Form from a URL


    Sincerely,

    Alex

  • jagarolik
    Replied on October 6, 2021 at 4:06 PM

    Thank you for your reply. There is an issue with the suggestion of using a matrix. Over time, our firefighters come and go. We have new ones join the roster and others leave the department.

    This results in an issue with our reporting. If a row is added or removed from the matrix, and then somebody needs to go check the report of attendance, the results displayed in the report are no longer valid.

    Thus, I need to either find a solution consistent with what I originally described using a series of checkboxes OR I need to find a way to prevent this error from ever happening with the matrix if when rows are added or removed.


    Thanks

  • Alexander_G
    Replied on October 6, 2021 at 5:35 PM

    Thanks for your reply.


    Let us check other workarounds for you.

    Soon we will get back to you.


    Thanks,

    Alex

  • Alexander_G
    Replied on October 6, 2021 at 6:12 PM

    Unfortunately, it's not possible yet to add to the line the result of different Multiple Choice elements.


    However, it's possible to separate the form to one firefighter per submission.

    Like the form where the firefighter chooses the engine, other information and then submits the form.


    After that - you may filter the data with different filters in JotForm Tables to achieve that.

    If this variant is suitable for you - we can prepare a demo for you.


    Thanks,

    Alex

  • jagarolik
    Replied on October 7, 2021 at 6:21 PM

    Hi Alex,

    Thank you for your reply. Unfortunately, as a roll call attendance sheet it is not useful to have the form account for only one firefighter per submission. We are taking attendance of up to 30 firefighters per submission and therefore it would have to be multiple firefighters per submission.

    Considering your previous solution using matrices, would it be possible to make it so that rows can be added and removed from the matrix without impacting the results found in a report? If that were the case then I could use the matrix solution.

    Thanks

  • Parker JotForm Support
    Replied on October 7, 2021 at 7:21 PM

    Hello,

    What do you mean by impact results found in a report? If you have the input table and add rows you can show/hide whichever rows that you want in the report.

    1633648810 615f80aabf543  Screenshot 10

  • jagarolik
    Replied on October 7, 2021 at 8:25 PM

    For a roll call attendance sheet, each row in a matrix represents a person. Over the years, people come and they go. As names are added or removed from the list, the data in the matrix becomes skewed.

    I do not see any way that I can merely show/hide rows in a matrix, so there is no way for me to keep rows permanently in the matrix. If this is the case, the next time I add or remove a somebody (a row) to the matrix, everybody lower in the matrix will be shifted over one row and the data will no longer be valid.

  • Laura JotForm Support
    Replied on October 7, 2021 at 9:19 PM

    Hi,

    In what format is the final roll call attendance sheet that you are using?
    Do you have your own template for this, and are you looking to import the data from the online form to the sheet? Or would for example using Jotform Tables for the attendance sheet work?

    With the matrix field, you can delete and add new fields. When you add a new row to the matrix, it will be added as the last row. However, when you delete rows from the middle of the matrix, the rows below will move one row higher. Unfortunately, it is not possible to hide/show rows on the matrix field.

    If I understood correctly, the attendance sheet will need to have the same rows at the same place, even when personnel change. Is this correct? Is there also a deeper reason for this?

    I am asking these questions to understand better what is required in this use case, and if there would be another solution than the matrix field, such as using Jotform Tables.

    Looking forward to your reply.


  • jagarolik
    Replied on October 9, 2021 at 1:34 PM

    Thank you for your response

    It is likely best to provide the example of what we are working with. Here is the active form that we have been using for years: https://form.jotform.com/33226011831138

    You will have to consider, if a firefighter leaves the department, our practice has been to delete the row. The impact that that has on the results of all subsequent rows is that the data becomes off by one row. Furthermore, if we add a new firefighter to the department this can also have a similar effect. I do not know which of these events (or both) is causing this problem, but it is why I am exploring breaking out each row into a separate question instead.

    We prefer the matrix style question because it is more efficient for the person filling out the form, but we have some very important features that we need:

    1. when adding or removing rows from the matrix, we cannot have the data become affected.
    2. having the ability to develop reports on each firefighter (row) would be very useful

    Furthermore, an additional feature would be very nice, though is not a requirement:

    • having the column headers be "sticky" and always visible when somebody scrolls down the very long list
  • Amin JotForm Support
    Replied on October 9, 2021 at 3:29 PM

    Hi again,

    Removing/adding a row/column of the input table on the form will also impact submissions. To go around this, you may create duplicates for the input table and use calculation conditions to populate a duplicate with the data entered in the original, automatically. This way, when you add/remove rows/columns from the original, the data will remain untouched in the duplicate. You will need a duplicate for each change.

    The last feature is unfortunately not possible, as it requires injecting JavaScript code, which is not allowed unless you use the form source code.

    Should you have any further inquiries, we will be more than happy to help.