Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hi Team,
I am facing this issue mentioned below:
I want to prevent sort ascending order .Please help on this and provide solution
Thingworx Version-V8.5.6
If you are generating this in a service, then you can apply your desired sort in the service before setting it to result.
Hope that helps.
Hi PaiChung,
Thank you for your reply
Applying desired sort means,not understood clearly, can u please explain or share some code if you have as an examples?
Currently, I am not applying any sort in service, You can see in screenshot, Whatever , I am sending as an input sequence, same I want in infotable service output. without sort ascending order
Hello,
Can you provide some code snippets from your service to help us understand how you are building the infotable. My assumption from your screen shot and using "Dynamic Columns" is that you are creating the data shape for the info table on the fly either entirely or adding columns to an existing data shape using AddField or fieldDefinitions.
In either case column order is not guaranteed to be in add order by default. If you want to guarantee columns are in a specific order you must specify the ordinal property when adding the column. Please see the following support cases for examples: CS313173 CS388066
Thanks,
Travis
Hi Team,
Thank you for providing to set ordinal property information.
Now, Service giving desired output when executing service manually from composer but when checked in runtime 'Developer Tools' not getting desired output
Pls check both screenshot
Let me know any solution on it
A json object does not account property order. (https://stackoverflow.com/a/16870531)
The "ordinal" property is a twx-specific metadata which twx toolings will consider. The "wanted" order you can see in developer tools response in "datashape" (your screenshot shows the "rows" of the response)
May I ask the use case why you rely on the order of the properties?
Because, Order of Input can be anything, ascending OR descending, the service should provide output whatever input order coming.
Hi @MM_10159448.
Why are you concerned with the order displayed in Dev Tools if Composer is displaying in the desired order? Dev Tools is strictly the response that is returned. It may not present in the desired order determined by the ordinal.
Regards.
--Sharon
After applying ordinal logic, Service giving desired result based on input any sequence provided but same checked in runtime 'Devtools' preview tab,It is again converting to ascending order
This is the problem