How can we make it easier for you to develop on top of Wild Apricot?

API and custom fields - how to reference them in $select or $filter

Hi. According to some of the documentation it implies that I can use a custom fields' name to reference it. I can directly reference common fields as a $select parameter, but can only reference other fields using their custom-xxx tag, like this:

'$select' => 'First name, Last name, Email, custom-8097667,
custom-8097668, custom-8161502, custom-8097675, custom-8017535'

The custom field tag does not seem to appear anywhere in Membership fields area of the WA database though so the only way I can find it out is by trawling through json data manually.

Is there a better way to reference those fields, or to find out their custom-xxx reference (as I've mentioned, I've looked through the WA membership fields in the actual WA site and can see no obvious use of this custom-xxx referencing). The code snip below is part of the json returned on a full dump, and SystemCode is the only place that I can see that references the custom field number:
json data referencing a custom field:

[6] => Array
(
[FieldName] => Practice Address 1
[Value] => 40 Test Way
[SystemCode] => custom-8097667
)

1 vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Stu shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

3 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Stu commented  ·   ·  Flag as inappropriate

    Thanks Dmitry. contactFields call is useful. I think I'd tried field name but wrapped in double-quotes, which as you say, fails. This should help!

  • AdminDmitry Smirnov (Product Owner, Wild Apricot by Personify) commented  ·   ·  Flag as inappropriate

    There are 2 possible ways to address a field: by field name or by system code.

    If you work with system codes you can be sure that it can't eventually be changed. If you work with field name, then changes in UI could affect your integration code.

    How to use $select and $filter parameters:

    1. Use Field name or system code, both of them will be understood by API
    2. Enclose field names in single quotes. This symbol ' - OK. These symbols " ′ ‘ ’ will not work.

    Here is an example:

    $filter='First name' eq 'John' and 'Age' gt 21

    $select='First name','Last name',Phone

Feedback and Knowledge Base