I have a list of Things that I am trying to fetch in a Server Script using Thing.get(). It seems that when the Thing’s Order Num (a Number) Field contains a zero value, the .get() method returns null instead.
Yes, and how does a Promise affect whether the response returns a null when it should return 0?
As you can see in my screenshots, I have no issue printing orderNumber for the Thing titled “my title” using await Thing.get("orderNumber"). So I fail to understand the relevance of your point.
You didn’t share your code, so I was just reminding that you need to handle the Promise.
Without the code you can only get some wild guess because only you know what you are doing.
If you are 100% sure that is a bug you should file a bug report. I did it in the past when I found bugs in the plugin api. If you create a clean test plugin with only an action with minimal code, and a clean app with only a page clearly reproducing the code the request get escalated quickly, and it’s also a good way to check yourself if it’s a bug.
Thanks for confirming.
I just opened the Bug Reporting form. That’s way too much effort for me. Feel free to report it.
Current workaround to the “Number 0 to Null” issue is to replace all Number fields with String fields, and casting to Numbers when needed. The String 0 returns correctly using Thing.get(prop). String versions of digits seem to sort correctly too, so need to cast to number when sorting.