<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.srevilak.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Setup_for_a_Large_CiviCRM_intake_form</id>
	<title>Setup for a Large CiviCRM intake form - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.srevilak.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Setup_for_a_Large_CiviCRM_intake_form"/>
	<link rel="alternate" type="text/html" href="https://www.srevilak.net/wiki/index.php?title=Setup_for_a_Large_CiviCRM_intake_form&amp;action=history"/>
	<updated>2026-05-11T15:40:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://www.srevilak.net/wiki/index.php?title=Setup_for_a_Large_CiviCRM_intake_form&amp;diff=203&amp;oldid=prev</id>
		<title>SteveR: initial revision</title>
		<link rel="alternate" type="text/html" href="https://www.srevilak.net/wiki/index.php?title=Setup_for_a_Large_CiviCRM_intake_form&amp;diff=203&amp;oldid=prev"/>
		<updated>2015-07-29T01:59:27Z</updated>

		<summary type="html">&lt;p&gt;initial revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I&amp;#039;m working on a project that involves case management, CiviCRM, and a&lt;br /&gt;
large (approximately 300 question) intake form.  After trying a few&lt;br /&gt;
different recipies, here is what finally worked the best.  The&lt;br /&gt;
screenshots come from my development CiviCRM instance.&lt;br /&gt;
&lt;br /&gt;
First, we need an activity type for our Intake form.  I called mine&lt;br /&gt;
&amp;quot;Intake B&amp;quot;.  Here&amp;#039;s how the activity is configured.  Note that it&amp;#039;s&lt;br /&gt;
a &amp;quot;Case&amp;quot; activity.&lt;br /&gt;
&lt;br /&gt;
[[Image:Intake-b-setup.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next we need a case type.  I called mine &amp;quot;Test foreclosure&amp;quot;, since the&lt;br /&gt;
work involves foreclosure support.  One of the Case Activites is&lt;br /&gt;
&amp;quot;Intake B&amp;quot;, which is our intake form.&lt;br /&gt;
&lt;br /&gt;
[[Image:Test-foreclosure-activities.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our intake form needs fields.  I spread these fields over five custom&lt;br /&gt;
fieldsets (so, 60 questions per fieldset).  Why do this?  Under the&lt;br /&gt;
hood, CiviCRM creates a database table for each fieldset.&lt;br /&gt;
Given enough fields, there are two issue you can run into&lt;br /&gt;
&lt;br /&gt;
* The size of your record might exceed the maximum database record size.  With MariaDB/XtraDB, this is 64k.  If you run into this limit, you&amp;#039;ll have to use different fieldsets.&lt;br /&gt;
* UI.  If you put too many fields in a custom fieldset, Civi&amp;#039;s Custom&lt;br /&gt;
* Fieldset UI (Customize Data and Screens &amp;gt; YOUR FIELDSET NAME &amp;gt; view and edit custom fields) becomes very unresponsive.  Simply refreshing the page caused my browser (Firefox or Chromium) to peg a CPU for several seconds at a time.  A javascript profiler tells me the CPU time is being spent in jquery.min.js.  If I had more bandwidth, I&amp;#039;d try to understand what &amp;lt;tt&amp;gt;civicrm/admin/custom/group/field&amp;lt;/tt&amp;gt; is doing with jquery.  Lacking bandwidth, I&amp;#039;ll use fewer fields per fieldset.  60--75 fields gives acceptable performance.&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s the configuration for one of my custom fieldsets.  Note that&lt;br /&gt;
the fieldset is used for Activities of type &amp;quot;Intake B&amp;quot;.  I used the&lt;br /&gt;
same setup for each of the five custom fieldsets.&lt;br /&gt;
&lt;br /&gt;
[[Image:Custom-fieldset-settings.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The real version will have a more descriptive name than &amp;quot;Custom&lt;br /&gt;
Fieldset 1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve spread our intake form across five different fieldsets, and&lt;br /&gt;
under the hood, CiviCRM has spread these across five different&lt;br /&gt;
database tables.  In the database world, we call this process&lt;br /&gt;
`denormalization&amp;#039;.  In the final version, I&amp;#039;ll try to denormalize by&lt;br /&gt;
form section, so that each major sections goes into a separate table.&lt;br /&gt;
&lt;br /&gt;
CiviCRM custom value tables have an `entity_id&amp;#039; column, which in our&lt;br /&gt;
case, will be an activity ID.  When Civi needs to reassemble one of&lt;br /&gt;
our Intake B activity records, it&amp;#039;ll essentially be joining columns on&lt;br /&gt;
their activity id.&lt;br /&gt;
&lt;br /&gt;
To wrap up, we have some webform/webform_civicrm things to configure.&lt;br /&gt;
There&amp;#039;s a contact (the case client)&lt;br /&gt;
&lt;br /&gt;
[[Image:Webform-contact.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There&amp;#039;s a case&lt;br /&gt;
&lt;br /&gt;
[[Image:Webform-case.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And there&amp;#039;s an activity&lt;br /&gt;
&lt;br /&gt;
[[Image:Webform-activity.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The webform is configured to&lt;br /&gt;
&lt;br /&gt;
* Use a progress bar,&lt;br /&gt;
* enable &amp;quot;Save Draft&amp;quot;,&lt;br /&gt;
* and automatically save drafts between pages&lt;br /&gt;
&lt;br /&gt;
There&amp;#039;s a page break every 15 questions or so.  That&amp;#039;s a lot of pages,&lt;br /&gt;
but I think this will provide a decent amount of protection against&lt;br /&gt;
data loss.&lt;br /&gt;
&lt;br /&gt;
Webform warned me that my 300 question form (with some extra field for&lt;br /&gt;
contacts) used 1200+ form fields.  To accomodate this, I had to&lt;br /&gt;
make a small addition to php.ini&lt;br /&gt;
&lt;br /&gt;
  max_input_vars = 2000&lt;br /&gt;
&lt;br /&gt;
This could be lower; 2000 gives us headroom, in case anyone wants to&lt;br /&gt;
add more fields to the form.&lt;br /&gt;
&lt;br /&gt;
How does one create 300 fields to test a large form?  CiviCRM&amp;#039;s&lt;br /&gt;
CustomField API works very nicely.  If you understand REST, Help &amp;gt;&lt;br /&gt;
Developer &amp;gt; API Explorer provides all the details you need.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellany]]&lt;/div&gt;</summary>
		<author><name>SteveR</name></author>
	</entry>
</feed>