Using Contenttype in charts

by FrikkFossan » Fri Apr 28, 2017 10:36 am

Hello.

I want to be able to group by ContentType for my statistics in the charts.

I've seen this: viewtopic.php?f=19&t=1124

But the answer is only getting the ContentType Id, so this is only part of my problem.

EDIT:
I've tried to in CAML-query:
<View>
<RowLimit Paged="TRUE">5000</RowLimit>
<ViewFields>
<FieldRef Name="ContentType"/>
<FieldRef Name="ID"/>
</ViewFields>
</View>


But when I try to
handlers.init = function (data, logger, processor, el, model) {
model.fields.push('ContentType');
return true;
}

The Group by "ContentType" I get nothing in my chart

I group by ContentType and count by ID

Please help.
User avatar
FrikkFossan
 
Posts: 2
Joined: Fri Apr 28, 2017 10:23 am
Location: Oslo Area, Norway

by Dmitry Kozlov » Mon May 01, 2017 8:55 am

Hi Frikk,

You can retrieve the Content Type ID and then use it for grouping:

Add the reference into the CAML-query:

Code: Select all
<View>
  <ViewFields>
    <FieldRef Name="ContentTypeId"/>
  </ViewFields>
  ...
</View>


And add it to the model in the Advanced tab:

Code: Select all
handlers.init = function (data, logger, processor, el, model) {
  model.fields.push('ContentTypeId');
 
  logger.debug('Data is initialized: ', data);
  return true;
}


Here you go:
ContentTypeId.png
ContentTypeId.png (4.39 KiB) Viewed 67 times
User avatar
Dmitry Kozlov
 
Posts: 126
Joined: Wed Nov 12, 2014 3:24 pm


Return to Dashboard Designer for SharePoint 2013