</> Developers Guide to Funraisin

Custom Fields

When you are wanting to capture additional information that falls outside of our Structured data then there are 2 choices, Webforms and Custom Fields.

Custom Fields vs Webforms

A common dilemma with a site is what is the best way to capture data when you are wanting to capture data that sits outside of the standard structured data fields.

Custom Fields are fields that are hard coded into a template whereas Webforms are built using the form builder from within Funraisin. Custom Fields are much more robust and can be used when you are wanting to use the captured data for things like leaderboards or to display on a fundraising page, whereas Webforms are best used for just basic data capture e.g. Where did you hear about us?

Custom fields do have their limitations, you can only capture Custom Fields from within certain parts of the site e.g. Registration forms.

When best to use what

The best thing to think of when looking what type of fields to use is to ask yourself how is this data going to be used once it's captured. If you are going to want to do certain things with the data other than just downloading it, such as displaying it on a fundraising page or using it for a SQL query on a leaderboard then we always go with hard coded Custom Fields.

If you are just wanting to capture the data and have it available for download then we always go with Webforms everytime.

Custom Field Types

We support 4 types of Custom fields which are

Individual custom fields

These can be added to the following steps

  • Create account step in DIY and Online events
  • Create Page step in DIY and Online events
  • Create a team step in DIY and Online events
  • Merchandise step in Online events
  • Multi-invite step in Online events

Team custom fields

These can be added to the following steps

  • Create a team step in DIY and Online events

Organisation Page custom fields

These can be added to the following steps

  • Create an organisation page step in Online events

DIY Event custom fields

These can be added to the following steps

  • Create Page step in DIY events

There are also donation custom fields available in the admin but these aren't able to be added to donation pages (yet)

Data Structure

Members_Custom_Fields

["id","member_id","history_id","form_id","field_name","field_value","last_updated"]

Donations_Custom_Fields

["id","donation_id","field_name","field_value","last_updated"]

Events_Custom_Fields

["id","event_id","field_name","field_value","last_updated"]

Teams_Custom_Fields

["id","team_id","field_name","field_value","last_updated"]

Adding a Custom Field

To add customfields to a template you can use the following syntax where "Field_Name" is the name of the field you want to create e.g. customfield[cats_birthday]

Individual Fields

< input type="text" name="customfield[Field_Name]" id="SomeID" value="< ?=@ShowDataText("field_name",$CustomFields); ?>" />

< textarea name="customfield[Field_Name]" id="SomeID" >< ?=@ShowDataText("field_name",$CustomFields); ?></ textarea >

Team Fields

< textarea name="teamcustomfield[Field_Name]" id="SomeID" >< ?=@ShowDataText("field_name",$TeamCustomFields); ?></ textarea >

Orgpage Fields

< input type="text" name="orgcustomfield[Field_Name]" id="SomeID" value="< ?=@ShowDataText("field_name",$OrgCustomFields); ?>" />

DIY Event Fields

< input type="text" name="eventcustomfield[Field_Name]" id="SomeID" value="< ?=@ShowDataText("field_name",$EventCustomFields); ?>" />

Field Types

The type of fields can be any html field, so input, select, textareas can all be used. Only image uploads can't be used.

Personalisation

Sometimes the choice for using custom fields is so you can access the data on pages such as Fundraising pages or in automated emails (though webforms can do this also)

To acess data from a custom field you can use the Personalisation tag {custom_NAME_OF_FIELD}