Jump to content
Server Maintenance This Week. ×

Radio button/Checkbox based on a condition


Recommended Posts

  • Newbies

I'm building a survey app and I have multiple types of questions that fall broadly into two categories: Single Mention and Multiple Mention. Is there a way to conditionally set the answer fields to either be radio buttons or checkboxes depending on the question type? For example, each question has an "instruction" field that says if it's One Mention or Multiple Mention. So I'd like to do a condition like If MyTable::InstructionText = "One Mention" the responses are radio buttons and if it's Multiple Mention, it's a checkbox set. 

Link to comment
Share on other sites

I would not use the native radio / checkbox but would rather use button bar segments and with your template for the survey indicate the response type. And use hide object when feature to hide or show the controls needed, to allow the single or multi selections. 

I build an survey for inspectors using button bar segments 
image.png

 

another option

 

Link to comment
Share on other sites

You cannot conditionally format a field to be either a checkbox or a radio button set.

But you can place two separate instances of the field onto the layout and hide one of them based on the question type.
Or place them in separate panes of a slide control object and use an OnRecordLoad script trigger to select the correct pane.

 

Edited by comment
Link to comment
Share on other sites

  • Newbies

I think I'm leaning more toward having the separate instances of the field on the layout and hiding them based on type. OceanWest, thank you for the response. I don't really understand how I would use that for these questions. Here are a couple of examples:

Are you the person, or do you share in the responsibility for making financial decisions for your household?  
(ONE MENTION)
DECISION MAKER-FINANCIAL     02600001

 1    Yes/Share 
 2    No    

 

At which financial institutions do you currently have any type of account?  (MULTIPLE MENTIONS)
PROBE: WHAT OTHERS?    
PROBE: CREDIT UNION – “SPECIFICALLY WHICH ONE?” 
ALL INSTITUTIONS             02600351

1    Bank of America                       24    Lake City Bank
2    Beacon Credit Union                25    Midwest America Federal CU
3    Capital One                               26    Old National               
4    Centier Bank                             27    Online Bank (no local branches)
5    Charles Schwab                        28    Partners First FCU
6    Chase                                        29    Philips Federal CU
7    Chime                                        30    PNC Bank
8    Citibank                                     31    Professional FCU (ProFed)
9    East Allen Co. Schools CU       32    Public Service CU
10    Edward Jones                         33    Salin Bank
11    Farmers & Merchants Bank    34    Star Financial Bank
12    Fidelity                                     35    State Bank & Trust
13    Fifth 3rd Bank                         36    Teachers Credit Union
14    Financial Partners Federal Credit Union        37    Three Rivers Federal CU
15    First Merchants Bank                38    Thrivent Financial
16    First Source                               39    Union Federal Savings Bank
17    Fire Police City County FCU     40    USAA
18    Flagstar Bank                             41    Wells Fargo
19    Fort Financial Federal CU          42    Woodforest National Bank (Walmart)
20    Garret State Bank                     43    Other (Specify)
21    General Federal CU                   44    Don’t Know      
22    Horizon Bank                             45    None     
23    IAB Financial                              46    Refused    

Link to comment
Share on other sites

2 hours ago, Bob Von Scio said:

Is there a way to conditionally set the answer fields to either be radio buttons or checkboxes depending on the question type?

I'm wondering if Google Forms, better meets your requirements here, and the case being more or less:

https://www.filemakermagazine.com/videos/capturing-data-google-forms

--sd

Link to comment
Share on other sites

The way I would structure the logic would be the following:

A template table this table could have child records if needed to outline the type of questions and responses you are asking. A template should be frozen for a particular campaign once deployed as any changes to the questions and response would skew any results. 

Each question to your respondent would present them the question and the target field for validated response:

  • Text (large, small)
  • Number ( integer, negative, in-range)
  • Currency ( integer, negative, in-range)
  • Percentage 
  • Boolean ( true, false) 
  • Date ( < = > value, in-range, duration )
  • Single Pick ( radio button )
  • Multiple Pick ( checkbox )
  • Likert Scale (defined rank)

The user would have a session record where that is a join between the template and the user (if you need a blind survey it would be proxy for the person providing responses) 

The template itself could be represented as a JSON object and stored on the survey session record then you could build UI to iterate thru the object as you progress thru the questions, and responses. And then present the proper fields or other elements to allow the user to enter the values. ( it may be much more easier to use a web view with some JavaScript to render these dynamic elements ) 

If you need to do metrics across a tranche of user responses the method of how the data is stored, that can get tricky to extract. ie of the 100 users who took the survey 40% answered False to question 4. 
 

Link to comment
Share on other sites

7 minutes ago, Bob Von Scio said:

functionality and it can't be offloaded to another application

You could put it into a web viewer! See if you can Google translate this:

https://www.filemakerbloggen.se/post/google-forms-och-filemaker

(BTW it's in swedish if the auto detection fails)

--sd

Edited by Søren Dyhr
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.