Count items

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
danieljr
Posts: 4
Joined: Wed Jun 28, 2017

17 Oct 2017

Hello Nikita,

Thanks for your reply on my previous post!
How can I use a show an number / amount of items in the current list based on the value of some fields ?

Thank you,

Daniël Pharazijn | IT-department | AG Stedelijk Onderwijs Antwerp Belgium
Thank you,

Daniël Pharazijn | IT-department | AG Stedelijk Onderwijs Antwerp Belgium

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

18 Oct 2017

Hello, Daniël!
The easiest way to do it, would be to add Related Items control to the form, select the same list, All Items view and Show all items from the view. You can also hide it, so it wouldn't show up on the form, by placing this line into Maket -> Style config:

Code: Select all

display: none;
And now you can use this line of JavaScript to get number of items in the list:

Code: Select all

fd.relatedItems(0).data('ctx').ListData.Row.length;
Another way to get the number of items would be to send an async request to the list.
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests