Hot answers tagged

3

The easiest way to solve this would be to use either a custom class or a dynamic one when you serialize: var folder = _sitecoreContext.GetItem<ISomeFolder>(dataSourceId) var list = folder.SubItems; var json = JsonConvert.SerializeObject(list.Select(subitem => new { ...


2

I have faced the same issue during the implementation of Display custom facet on the Experience profile tab. @x3mxray helped me as well to implement the same. As per the article http://zhenyuan.azurewebsites.net/post/displaying-custom-facets-in-contact-profile you followed, the controller will return your facets values, but it's not serialized so you will ...


2

Your issue is that each facet has an XObject object on it that contains a lot of circular references. The XObject will never serialize, you just need to tell NewtonSoft to ignore it when serializing. You can do this with a DefaultContractResolver. You can see this working in my repo. https://github.com/buildabonfire/Bonfire.Analytics.Dto Your facets will ...


1

Adding in an answer as I can't add json properly in the comments, can you try with the following? { "name": "SiteContent", "path": "/sitecore/content/ABCGroup/ABC", "rules": [{ "path": "/Settings", "scope": "SingleItem", "...


1

No, you won't get the results count in JSON Results response. Search Results and JSON Results responses are completely different things. In order to do that, you would need to make some modifications to RenderJsonVariantList method in Sitecore.XA.Foundation.JsonVariants.Extensions.JsonVariantsExtensions. Ideally: copy the JSON Results rendering and ...


1

It seems that you try to return Sitecore.XConnect.Facet in server response to browser. Facet is a complex model with generic self-referenced properties. Try to create a simple class for view model only with fields that you need on client side, populate them from facet and use it for server response instead of Facet model. I have also faced this issue when ...


Only top voted, non community-wiki answers of a minimum length are eligible