Is there a way to get the count of items retuned t...
# help
z
Is there a way to get the count of items retuned through Rest endpoint?
n
Hello @zavbala! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
The length of the returned array?
n
zavbala (2022-05-27)
z
Yes
g
You just use length of the returned array... If JS, data.length.
z
Course, but through the rest API
Isn't possible?
Is possible return a json with alias
Like
Copy code
{
Items: returned array
}
g
rest returns json of form {[rec1,rec2]} So can't you just process that to get the array and length? You can get a count of items that match the query, but the returned amount might be less if more than your max rows setting.
You also get a header back if you want to process that: "content-range: 0-39/*" Where that is 40 rows. This though would be different with limits and range operations though.
z
Perfect, got it
Many thanks