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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Returning profile field id in Profile->get
Pages: [1]

Author Topic: Returning profile field id in Profile->get  (Read 339 times)

Jeremy Proffitt

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 2
    • Mobius New Media
  • CiviCRM version: 4.4.x
  • CMS version: Joomla 2.5.x/3.x / D7
  • MySQL version: 5.1.x
  • PHP version: 5.3.10+, 5.4.x
Returning profile field id in Profile->get
March 18, 2014, 05:46:38 am
I'm using the UFField API to get profile field metadata and generate both a form and page display of contact data outside of Civi (in Joomla). I'm currently using other APIs to get the data for the profile, as the Profile API doesn't provide any unique keys to link the UFField data to the Profile API output.

Was there any particular rationale in leaving this out? I'm considering extending the Profile API so that it would pass the UFField ID along with the field value, and therefore would be possible to merge the Profile output values with the UFField objects. I'd be interested in hearing if there would be a reason why this wouldn't be desirable going forward as a modification to core.
Jeremy Proffitt
Mobius New Media
IRC: JP_EzoD

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Returning profile field id in Profile->get
March 19, 2014, 07:34:22 pm
In theory

$profileFields = civicrm_api3('profile', 'getfields', array('action' => 'submit', 'profile_id' => $profileID));

should get the metadata & you can get the values for a given contact using profile.get & submit your results using profile.submit
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Returning profile field id in Profile->get

This forum was archived on 2017-11-26.