Loading ...

Company field aliased to 'Company1' or 'CompanyName'? | Communifire Support

Home » Spaces » Communifire Support » forum » Communifire API & Developers » Company field aliased to 'Company1' or 'CompanyName'?
Communifire Support

Leave Space :

Are you sure you want to leave this space?

Join this space:

Join this space?

Add a new tab

Add a hyperlink to the space navigation. You can link to internal or external web pages. Enter the Tab name and Tab URL. Upload or choose an icon. Then click Save.

The name that will appear in the space navigation.
The url can point to an internal or external web page.
Login to follow, share, and participate in this space.
Don’t have a support community login?Create your account now
Posted in: Communifire API & Developers

Company field aliased to 'Company1' or 'CompanyName'?

Subscribe to RSS
  • alligatorphil

    I'm doing work for a client in their Communifire instance where I'm required to push values via the API to user profiles fields.  The one remaining problem that I have is that I'm supposed to push values to the Company field.  I noticed that there is also a profile field called Company1 visible on profile pages.

    • When I request the value for the Company field, I get back the value for Company1. (Which is the same response I get if I actually ask for Company1 or CompanyName)
    • When I set the value for Company1 in the API, the profile field Company1 gets updated.
    • When I set the value for Company in the API, the profile field Company1 gets updated.
    • When I set the value for CompanyName in the API, nothing happens.

    How is it that I'm unable to set the value for Company, and is there some field mapping behind the scenes between API field names and actual field names as they are labeled on profile pages?

  • gskamau

    Hey Philip,

    Could you check the IDs for the fields? On the edit profile page, right-click the field label, then click Inspect. In the HTML for the field, you should see something like data-fieldid="14" . Are the IDs different?

    Grace

  • alligatorphil

    On my own profile page, the Company1 field has the id Field29-D13094.  The Company field (which is a dropdown/picklist) has the id Field99-D24188.   

  • gskamau

    Hey Philip,

    Which API are you using? REST API: Update User Profile Fields ?

    Grace

  • alligatorphil

    Hi Grace,

    Yes, that's the one.  I'm only updating profiles (not adding) so addUser=false is also in my querystring.   I'm also using /api/content/{userId}?contentTypeID=15&fields={csv list of fields} to check field values. 

  • gskamau

    Hey Philip,

    Could you edit your profile here and add your Communifire website address?

    Grace

  • alligatorphil

    Hi Grace,

    It's already there.  Are you not seeing it?  Should I put it here as well?

  • gskamau

    Hey Philip,

    I got it, thanks.

    This appears to be a bug. Communifire comes with a built-in user profile field named "Company". On your site, this field was renamed to "Company1" and a new "Company" field was created. When you're trying to update or retrieve "Company" via the API, the built-in field is affected, instead of the field labelled "Company". I've created a case for our developers to address this issue.

    In the meantime, you can either change the profile field labels or use the IDs instead of the labels. For the latter, just replace the field label with its ID.

    Grace

  • alligatorphil

    Thank you Grace.  That's bit of a relief since we were pulling our hair out trying to figure out what we were doing wrong. 

    In the meantime, you can either change the profile field labels or use the IDs instead of the labels. For the latter, just replace the field label with its ID.

    Are you saying that I can treat the ID in the markup as the field name on the API?   Push the value to Field99-D24188 to affect the new Company field that the client created?  

  • gskamau

    Hey Philip,

    The ID would be 99. In the HTML, the div that wraps the field should have data-fieldid="99" as one of its attributes.

    Grace

  • alligatorphil

    Understood.  That working for me.  Much thanks!! 

Page 1 of 1 (11 items)