displayOrder API param not working / Schema Endpoint

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:

The correct order should be:

1. name

2. description

3. date

4. time

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

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.

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

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?

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.

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.