Is there any way for creating a simple form in Sitecore through dynamically using code so that it appears in the Sitecore Forms UI?
Any suggestion appreciated.
Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up.
Sign up to join this communityIs there any way for creating a simple form in Sitecore through dynamically using code so that it appears in the Sitecore Forms UI?
Any suggestion appreciated.
Though, I don't see the use case for your question, a form is just contructed by a tree of sitecore items. So in theory, you could create those items through code, like you would create other sitecore items with the Sitecore API.
To make it appear in the Forms UI, you would need to index them to the master index, as the list is builded from the master index.
If you would like to see the structure of the items you need to create, I would suggest to create a sample form through the UI, and get a look at the created items.