The language of your Sitecore Forms is more important than you thought

Every so often I run up against an issue that’s right there in the docs, but somehow has passed me by. This week that issue was Sitecore’s new V9 forms implementation, and it’s relationship with languages…

Edited to add: Sitecore seem to have managed to push out a fix for this in the time between me starting to write this and publishing it… If you deploy v9.0 Update 2 this should be resolved, according to the release notes. But I’ll post this anyway because not everyone will upgrade right away…

If you’re working in a situation where your default content language isn’t “en“, and you try to create a new Sitecore form, you may get a bit confused. I was creating forms on a site where “en-GB” was the default:

And it was set in the <site/> config:

I could happily create a new form via the shiny new form editor, and save it:

And the form would appear in the content tree:

But when you come back to the “choose a form to edit” view in the designer:

Where’s it gone? Cue some head-scratching…

Now there are a few blog posts about that discuss the issue of forms not being visible when you try to return to them. But these weren’t an issue in my specific case.

So digging a bit I noticed that even with the default language being “en-GB” for the site, the ajax requests that are being made to populate the “pick your form” UI are:

http://site/-/item/v1/sitecore/shell?search=&searchConfig=%7B60F35FD9-88CB-4DF5-8E78-1E9BF5FE181C%7D&sc_content=master&language=en&fields=__Created%7C__Updated%7C__Thumbnail&pageIndex=0&pageSize=25
http://site/-/item/v1/sitecore/shell?search=&searchConfig=%7BA7C51A03-028A-4414-98DF-116DFAEAE5A6%7D&sc_content=master&language=en&sorting=d__smallcreateddate&fields=__Created%7C__Created%20by%7C__Updated%7C__Updated%20by%7CClassification%7C__Thumbnail&pageIndex=0&pageSize=50

and

http://site/-/item/v1/sitecore/shell?sc_itemid=%7BAC27A304-1EED-487B-965E-C993C561C6A7%7D&sc_database=core&language=en

What’s special about those? Well they all include the clause: “language=en” and we know (thanks to our default language) that our form items don’t have a version in that language:

So, what happens if we just add a version in the “en” language? Well pretty much instantly, we can see:

Success!

Now it’s only the root item of the form which needs updating to make the form visible:

If you actually want to have proper language variations of the form itself, you can use the form editing UI to decide which language you want to edit:

You don’t need to manually create any of the other versions via Content Editor. But of course you need the form to be visible in the Forms editor in the first place to make that work…

Now, this issue is mentioned in Sitecore’s documentation for the forms editor:

But if your default language is something other than “en” it’s easier said than done to follow the instruction to “first save the form in the default language” – so until we get an update that fixes the choice of language for the UI’s search queries, you may have to keep adding the “en” version of your form items manually…

Advertisements

3 thoughts on “The language of your Sitecore Forms is more important than you thought

  1. Possibly will get fixed in the next update, but for now, if you want to show all the forms (regardless of the language it was created in), you can delete the language filter in the Core database – /sitecore/client/Applications/FormsBuilder/Pages/Forms/PageSettings/DataSource – in this item, clear out the Language field. It will then search all languages. And then if you want to hide certain users from seeing certain forms, you can do that with security. I assume there is a probably a way to add a language filter in the ‘all forms’ screen using SPEAK, but I haven’t gotten there yet :-/

  2. Pingback: I’m sure my renderings were there yesterday? | Jeremy Davis

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.