Skip to main content
Solved

Using HTTPCaller to CityWorks for Equipment Upd and Add - cant import custom fields

  • October 2, 2025
  • 2 replies
  • 45 views

rjohnsoncos
Contributor
Forum|alt.badge.img+2

I am trying to both add and update Equipment to CityWorks using the HTTPCaller - it seems to work fine except for custom fields.  They do not seem to add or update with the equipment record. I am passing in the “Data” query string parameter with the following json data:

{"EquipmentUid":"@Value(EQUIPMENTUID)",
"Description": "@Value(DESCRIPTION)",
"Manufacturer": "@Value(MAKE)",
"Model": "@Value(MODEL)",
"ForCheckout": "@Value(FORCHECKOUT)",
"RateType": "@Value(RATETYPE)",
"UnitCost": "@Value(HOURLY_RATE)",
 "CustomFields": 
    {
      "FieldName": "DIVISION CATEGORY",
      "FieldValue": "@Value(DEPT_ID_DESC)"
    }
 }
 

This does not work but is what I could gather from the internet as correct (for the custom fields)

Best answer by frro

Hi,

Unfortunately, you can’t add CustomFields directly on the Add or Update Equipment endpoints.

The element to use is CustomFieldValues and it expects a Dictionary with key-value pairs.
The API documentation says: Dictionary<Int32, String>  CustomFieldValues

Example:

{

    "EquipmentUid": "@Value(EQUIPMENTUID)",

    "Description": "@Value(DESCRIPTION)",

    "Manufacturer": "@Value(MAKE)",

    "Model": "@Value(MODEL)",

    "ForCheckout": "@Value(FORCHECKOUT)",

    "RateType": "@Value(RATETYPE)",

    "UnitCost": "@Value(HOURLY_RATE)",

    "CustomFieldValues": {

        "1": "CustFieldVal_1",

        "2": "CustFieldVal_2",

        "3": "CustFieldVal_3"

    }

}

 

You will need to find your CustomFields and create the dictionary before generating the JSON request.

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

frro
Contributor
Forum|alt.badge.img+17
  • Contributor
  • Best Answer
  • October 3, 2025

Hi,

Unfortunately, you can’t add CustomFields directly on the Add or Update Equipment endpoints.

The element to use is CustomFieldValues and it expects a Dictionary with key-value pairs.
The API documentation says: Dictionary<Int32, String>  CustomFieldValues

Example:

{

    "EquipmentUid": "@Value(EQUIPMENTUID)",

    "Description": "@Value(DESCRIPTION)",

    "Manufacturer": "@Value(MAKE)",

    "Model": "@Value(MODEL)",

    "ForCheckout": "@Value(FORCHECKOUT)",

    "RateType": "@Value(RATETYPE)",

    "UnitCost": "@Value(HOURLY_RATE)",

    "CustomFieldValues": {

        "1": "CustFieldVal_1",

        "2": "CustFieldVal_2",

        "3": "CustFieldVal_3"

    }

}

 

You will need to find your CustomFields and create the dictionary before generating the JSON request.

 


rjohnsoncos
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • October 3, 2025

Thanks for the clarity and it worked fine after making that change!  I had seen that in the API documentation but when I lookin on line there where several posts that used “CustomFields”