0

I have events with custom fields. I want to show participants with the corresponding custom fields in a View. I can't find how to retrieve custom datas.

Is somebody have already created this kind of View?

Using Drupal 7.54 and Civicrm 4.7.16.

Thank you for your help.

12
  • Is your civicrm database part of your drupal database or separate. if separate then you have to add any new custom field groups you create to your settings.php file
    – petednz - fuzion
    Commented Feb 26, 2017 at 5:06
  • All datas are in the same database, and settings.php content the custom field groups. When I create à view of custom fields or groups, I see them.
    – olivier
    Commented Feb 26, 2017 at 9:54
  • Your responses here and to jack (mark) below leave me confused. Are you saying that you see custom fields belonging to some entities, eg Contacts, Contributions, but not for specifically Participants? You may need to paste an export of your View to help folk understand your issue
    – petednz - fuzion
    Commented Feb 26, 2017 at 19:37
  • Also if your drupal and civi is in the same db then you don't need to be adding the custom groups to settings.php
    – petednz - fuzion
    Commented Feb 26, 2017 at 19:39
  • I begin to understand... It seems that only custom field active for ALL events are seen in Views. In my case, custom groups are for specifics event, and they don't appears in View. If I define a custom group for ALL events, it appear in View menu. So I think that the question should be : "How to use custom field affected to specific event ?"
    – olivier
    Commented Feb 26, 2017 at 20:04

3 Answers 3

1

Create a new view.

Give the view a name

Show CiviCRM Participants

Create a page view perhaps, make sure there is a path

Continue

Add some fields, maybe you want the contact display name for instance The custom field will be available in a group "CiviCRM Custom [custom_group_name]" Add your custom fields...

Maybe you want only those participants for a given event?

Number of ways to do this, but lets just describe one way.

so lets say your View is at path "/event-participant-listing" Lets use a contextual filter, and filter by event id, so that "/event-participant-listing/1" would list participants for event with id 1

editing your view, Click the Advanced fieldset in the right column

Add a contextual filter "CiviCRM Events: Event ID"

Maybe set "When the filter value is NOT in the URL" to 'Display contents of "No results found"'

Make sure if you choose that to add a "Global: Text Area" to the "No Results Behavior"

1
  • I've tried, but I don't have any "CiviCRM Custom[...]. I think that I need to give some autorisations, but I don't find where.
    – olivier
    Commented Feb 25, 2017 at 14:50
0

There was a bug with this recently. Update to latest civi to solve. I posted a q about this (on phone or I'd link you)

3
  • I am now on 5.6.0, but the bug seems to remain ; do you think that 5.7.1 has fixed it ? Commented Nov 25, 2018 at 16:46
  • No, sorry. If you've overridden some PHP files that might explain it. I added some code to let Participants be added to Events.
    – JohnFF
    Commented Nov 26, 2018 at 1:34
  • Can you be more explicit : I personaly did not override any php file ; could the upgrade to 5.6.0 do that ? On an other hand, fuzion made some developments for me (search paramerization), which affected CRM/Contribute/Form/Search.php, CRM/Event/Form/Search.php, CRM/Member/Form/Search.php, CRM/Activity/BAO/Query.php, CRM/Activity/Form/Search.php, Those should be (or may have already) integrated in the core : could it be an explanation ? Commented Nov 27, 2018 at 6:36
0

This is a regression in 4.7. See issue CRM-20194: Only 'Contact' is treated at the end of civicrm/drupal/modules/views/components/civicrm.core.inc : $extendsContactSubtype = (('Contact'=== $dao->extends) && !empty($dao->extends_entity_column_value)); Replacing this line by : $extendsContactSubtype = (!empty($dao->extends) && !empty($dao->extends_entity_column_value)); seem to work (but I've not full tested).

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.