Forums

Setting a custom field

Hi - I'm trying to set a custom field through

https://api.elvanto.com/v1/people/edit.json


The field name is  "Date of baptism month"


I'm passing the object:

{"id":"XXXXXXXXX", "fields":{"Date of baptism month":"10"}}


And getting the error:

{"generated_in":"0.009","status":"fail","error":{"code":250,"message":"A field does not exist (Date of baptism month). Please check the documentation and try again."}}


Am I formatting Date of baptism month properly? Do I need to remove spaces or anything like that? I definitely pass the name of the custom field, don't I - I don't pass the custom ID of the field?


Thanks,

Murray

Hi Murray.


First you'll need to use a people/customFields/getAll api call, and get the ID of your custom field.


Then, once you have this, you'll want to use that ID in your API call. I believe you need to do something along these lines and add the text 'custom_' before the custom fields ID in the edit parameters though:

{"id":"XXXXXXXXX", "fields":{"custom_XXXXX":"10"}}

 Let me know how that goes.


Stewart

Great - that's got it. Thanks.

Actually, you might want to know. I'm passing:

({id:"XXX98", fields:{'custom_XX99b':"06"}})


and getting the response:

{"generated_in":"0.025","status":"ok","person":{"id":"XXX98","family_id":"764"}}


It's returning a reference to the family_id, not the field I'm passing to it. Doesn't look like it should be doing that, I would have thought.

Hi Murray.


This is to be expected. The response for the edit calls will always give you their ID, and the ID of the family that they are in. At this stage it doesn't reference the edit that you've made.


Stewart

OK - if that's the expected then there's no problem. It just gave me the terrible thought for a second that I had been updating hundreds of Family_ID fields with the values I had been trying to feed into a custom month value. I really didn't want all people put into 12 families based on their month of baptism!!


Login or Signup to post a comment