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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • how to update profile using api
Pages: [1]

Author Topic: how to update profile using api  (Read 676 times)

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
how to update profile using api
December 29, 2014, 03:31:15 am

I have created custom profile in civicrm.
i am able to get the value stored in the profile using api

Can any one tell me how to update profile  using api ?  if i want to update a particular field in that profile using civi api .

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: how to update profile using api
December 29, 2014, 03:51:19 am
It's the UFField entity (I know, not the most obvious name for a field in a profile ;)
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Re: how to update profile using api
December 29, 2014, 04:00:51 am
i want to update the value of the profile field

can you please write the api code

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: how to update profile using api
December 29, 2014, 07:43:31 am
Quote
i am able to get the value stored in the profile using api
I think you are confused. Profiles do not store any data. Contacts, contributions, participants, etc. store data. Profiles simply present forms to facilitate that.

Quote
can you please write the api code
No one is here to do your work for you. We can provide guidance if it looks like you have made a genuine effort to:
  • Read the instructions
  • Explore the api
  • Write some code yourself
If you've done all that and have a specific question about something you've tried that isn't working, please post a complete description of what you've researched, what you've tried, and where exactly you are stuck.
Try asking your question on the new CiviCRM help site.

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Re: how to update profile using api
December 30, 2014, 02:36:02 am
thanks for reply

I had created custom field. I want to update that custom field data. now i am using db query to update the custom table value. and that custom filed is used in the one of the profile .so i am retrieving the value using api(profile, get) method. But there isn't way to update that custom filed data using api, if you have contact id.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: how to update profile using api
December 30, 2014, 06:03:15 am
Forget about the profile, it has nothing to do with the custom field you are trying to change.

As Coleman suggested, use the api explorer and, well, explore. The entity to manage custom data is CustomValue, you'll probably have to use CustomGroup and CustomField to find out what is the id of the custom field you are trying to update.

Don't use the profile either to get the data, it's confusing you and makes the system more fragile and slow

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Re: how to update profile using api
December 31, 2014, 02:41:07 am
thank you very much sir.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • how to update profile using api

This forum was archived on 2017-11-26.