Try our conversational search powered by Generative AI!

Getting all FormContainerBlock blocks from the content repository is throwing this error: Property string too long, max {1} chars


I'm trying to get all the forms from the content repository and am trying this:

var formContainerType = _contentTypeRepository.Load(typeof(FormContainerBlock));
var formContainerReferences = _contentRepository.GetDescendents(ContentReference.RootPage);
var allForms = _contentRepository.GetItems(formContainerReferences, LanguageSelector.AutoDetect(true)).Where(content => content.ContentTypeID == formContainerType.ID);

But I get this error on `GetItems`:

EPiServer.Core.InvalidPropertyValueException: 'Property string too long, max {1} chars'

Am I pulling this right? Seems odd to be getting this error on items that are already created.

Jun 19, 2023 15:47


You probably should use the IFormRepository and IFormDataRepository interfaces to retrieve forms.

Then you should be able to do:

var forms = _formRepository.Service.GetFormsInfo(null); 
foreach (var form in forms){


Jun 20, 2023 9:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.