• Live group demo of Marketing Hub + Data Agent

    Standardize reporting, reduce manual work, and introduce AI without cleanup

    Join us on March 12
  • Ready to build your local HubSpot community?

    HUG leaders host events, spark connections, and create spaces where people learn and grow together.

    Become a HUG Leader

displayOrder API param not working / Schema Endpoint

ACarrillo7
Participant

Hey everyone, I'm having some issues when creating a new schema.

I want to set the order in which the properties should appear in the  UI but for some reason, is not working.

 

Payload: 

 

 

 

{
    "labels": {
      "singular": "playstation",
      "plural": "playstations"
    },
    "requiredProperties": [
      "name"
    ],
    "searchableProperties": [
      "name",
      "description"
    ],
    "primaryDisplayProperty": "name",
    "secondaryDisplayProperties": [
      "description"
    ],
    "properties": [
      {
        "name": "name",
        "label": "Name",
        "type": "string",
        "fieldType": "text",
        "description": "",
        "groupName": "playstation_information",
        "displayOrder": 1,
        "isPrimaryDisplayLabel": true,
        "optionSortStrategy": "DISPLAY_ORDER"
      },
      {
        "name": "description",
        "label": "Description",
        "type": "string",
        "fieldType": "text",
        "description": "",
        "groupName": "playstation_information",
        "displayOrder": 2,
        "optionSortStrategy": "DISPLAY_ORDER"
      },
      {
        "name": "date",
        "label": "Date",
        "type": "datetime",
        "fieldType": "date",
        "description": "",
        "groupName": "playstation_information",
        "displayOrder": 3,
        "optionSortStrategy": "DISPLAY_ORDER"
      },
    {
        "name": "time",
        "label": "Time",
        "type": "number",
        "fieldType": "number",
        "description": "",
        "groupName": "playstation_information",
        "displayOrder": 4,
        "optionSortStrategy": "DISPLAY_ORDER"      
      }
    ],
    "name": "playstation"           
  }

 

 

 

 

And the result in HS UI:

ACarrillo7_0-1710181962483.png

 

The correct order should be: 

1. name

2. description

3. date

4. time

Any idea on why the Date field is being displayed first?

1 Accepted solution
MattPickle
Solution
Participant | Diamond Partner
Participant | Diamond Partner

I think there may be a mistake in the docs. "displayOrder" is something you can set for each option in the options array of a dropdown property, but not for the property itself. You can see how displayOrder is used in the response example in the docs.
Screenshot 2024-03-12 at 2.49.15 PM.png

What you're looking at is the form to create a new object, which I believe can only be updated manually. The properties in the sidebar view of a record can also be re-ordered, but I don't think it can be done through the API. The main "View All Properties" list for a record is alphabetical within each group, and that can't be changed.

View solution in original post

0 Upvotes
3 Replies 3
GRajput
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

Hi @ACarrillo7 

The code is correct and works fine. The problem is with the order display for this you can go to the edit form setting and change the order, set it according to your requirements.

 

GRajput_0-1710232477365.png

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes
ACarrillo7
Participant

Thanks for your response Gaurav!

 

I don't want to change the order manually. From what I read in the docs you can set an order using this parameter 

"displayOrder": 4,

but it doesn't work or amI not understanding what this parameter is used for?

 

0 Upvotes
MattPickle
Solution
Participant | Diamond Partner
Participant | Diamond Partner

I think there may be a mistake in the docs. "displayOrder" is something you can set for each option in the options array of a dropdown property, but not for the property itself. You can see how displayOrder is used in the response example in the docs.
Screenshot 2024-03-12 at 2.49.15 PM.png

What you're looking at is the form to create a new object, which I believe can only be updated manually. The properties in the sidebar view of a record can also be re-ordered, but I don't think it can be done through the API. The main "View All Properties" list for a record is alphabetical within each group, and that can't be changed.

0 Upvotes