</> 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)

Ticketholder / Guest custom fields

These can be added on the multi-entry invite step (both ticketed and non-ticketed)

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); ?>" />

Ticketholder Fields

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

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.

Accessing Custom Field Data

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). See Data Access for a list of what you can access on each page.

Custom Fields are automatically available to access on Fundraising pages and within the Fundraiser Login Area, if you are editing a template you can simply use $CustomFields["field_name"]

Custom Fields are not able to be accessed in standard public pages or via the page builder. They require developer access and need to be added to the sites templates using PHP code.

Accessing in Automated Emails

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