SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to just return the # of replies value from the built in SP field ItemChildCount? It seems to store the values as a delimited string with the ID of the item associated as a reply and the # of replies. I can't figure this out.

share|improve this question

If you're working in a CQWP, I'm assuming you need to do this in XSLT. There are 2 functions, substring-before and substring-after that you can use. Depending on which part of the string use the appropriate one.

<xsl:value-of select="substring-after(@YourField, 'theDelimiter')" />

In your code, when you do the xsl:for-each, you'd add directly below that line an

<xsl:sort select="substring-after(@YourField, 'theDelimiter')" order="descending"/>
share|improve this answer
I can do this in a CQWP but once I have the # im not sure how i would order the items returned by that number. Thanks for the reply. – E7AD Apr 24 '13 at 17:54
Updated answer with additional info – Eric Alexander Apr 24 '13 at 17:58
im going to try and hook this up. thank you for the help. – E7AD Apr 24 '13 at 18:07
So i've tried but no no avail. When I order by substringed Itemchildcount w/ xsl:sort it doesn't re-order the results. – E7AD Apr 24 '13 at 20:19
Its like theres something wrong with the ItemChildCount built in field. No matter whay i try to do, it would appear you can't order items by "Replies" or "ItemChildCount" – E7AD Apr 24 '13 at 21:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.