CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Pull Custom Data Values into Views
Pages: [1]

Author Topic: Pull Custom Data Values into Views  (Read 561 times)

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Pull Custom Data Values into Views
October 11, 2013, 09:00:22 am
I have created a series of custom fields. They are a select list with Labels and Values. I can pull the labels into Views no problem - how can I pull in the values associated with them? Is this possible?

Thanks in advance for any help you can give!
www.ulearnschool.com

monish_deb

  • I’m new here
  • *
  • Posts: 5
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: 7.22
  • MySQL version: 5.5.31
  • PHP version: 5.3.10
Re: Pull Custom Data Values into Views
October 17, 2013, 07:04:27 am
Usually in case of select and multiselect element value(s) of Custom set are used for internal use that's why the very reason that only Labels are shown in Civicrm entities like Contact,Contribution etc. , Drupal views and other Drupal integration modules. As per your requirement I can provide you with patch for your use case in Drupal views if you need so. But I am confused with the kind of representation it will display for select element in Views. ??? 

Monish D.
« Last Edit: October 17, 2013, 07:10:03 am by monish_deb »

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Pull Custom Data Values into Views
October 22, 2013, 11:59:56 am
Hi,

Thanks for your response. I take your points on board. Ultimately I found a very easy way to grab the values associated with a select list.  I created a Global: PHP field and using the available variables I entered

return $row->host_room_prices_87;

into the value code box.

This returned the value of the custom field so I could use both the Label in one column and the value in the next in order to perform the necessary calculation in the View.

Hope that helps someone.
www.ulearnschool.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Pull Custom Data Values into Views

This forum was archived on 2017-11-26.