Anatoli
Design Dabbler

Assessment for Nintex Forms with JavaScript included

Jump to solution

Hi folks.

we are preparing a migration for a client from SP2013 on-prem to SPO. In order to have a better understanding of situation we would like to create a script querying where Nintex Forms are used.

We will use ShareGate to perform the migration and in few test we faced issues for forms which are using custom JavaScript functions (included in the form and referencing to external js files.
Another question to answer is if it is a responsive or classic form, as the responsive cannot be migrated automatically to Nintex Online.
Long story short, we would like to ask if it is possible to create a list and query following properties:

  1. go through defined site collections
  2. find all existing Nintex Forms
  3. get if it is a responsive/classic form
  4. get if JS is used (inline or referenced)

Ideally it would be possible to do it from the client side, as we are not farm administrators. But if this is the only way, we can execute the script with them together.

 

Are there corresponding web services / object models / whatever... that we could utilize to get this information?

 

Any hint/help is very appreciated. Thanks!

0 Kudos
Reply
2 Replies
kchaluvadi
Workflow Veteran

Re: Assessment for Nintex Forms with JavaScript included

Jump to solution

Hi Anatoli,

We had a similar requirement to find the responsive forms when migrating to SPO using Sharegate as Sharegate cannot migrate the responsive forms to SPO and there is no direct way to get the responsive form details sometime back in 2020.

Whatever is present in a Nintex form is stored in xml file. When compared the xml of classic and responsive form, we saa an element,  <IsResponsive>false</IsResponsive> for classic form, <IsResponsive>true</IsResponsive> for responsive forms.  And this xml is stored in the "NintexForms" database, "NM_Form" table, "FormXml" column. 

Then we queried Nintex Database with the following SELECT statement to find all responsive forms

SELECT * FROM [NintexForms].[dbo].[NM_Form] where [FormXml] like '%<IsResponsive>true</IsResponsive>%'

The above statement gives Site Id, List Id and List Name. From these details, you can have a PowerShell script to query the site title from web site Id. 

$webSiteId = 'xxxxxxxxxxxxxxxxxxxxx'

Get-SPWeb | Where-Object {$_.Id -eq $webSiteId} | Select Url

$siteId is the web id from SQL output

If you have lot of web site ids in the SQL output, have all them in CSV and loop thru them.

 

Similarly, there should be a way to find if the script is present in the xml file, search for <script> tag in xml file of Nintex Form. We had very few Nintex forms with script and we already know what they are.

 

PowerShell script to get all lists with Nitex Forms:

#Get all webs in a site collection to $webs
#loop thru each web
foreach($web in $webs)
{

$lists = $web.Lists
foreach($list in $lists)
{
foreach ($ct in $list.ContentTypes)
{
#check if Nitnex form
if ($ct.NewFormTemplateName -eq "NFListEditForm")
{
$nintexFormItem = New-Object System.Object
$nintexFormItem | Add-Member -MemberType NoteProperty -Name "Site URL" -Value $web.Url
$nintexFormItem | Add-Member -MemberType NoteProperty -Name "List Title" -Value $list.Title
$nintexFormsInventory += $nintexFormItem
}

}

}

}
#Export output to csv
if($nintexFormsInventory -ne $null)
{
$nintexFormsInventory | Export-Csv "filename.csv"
}

Note: Please excercise caution when trying out this solution. We tried this first on our development server, and then on production. As it requires using a SELECT statement only, no harm, but it is upto you whether to follow this fix or not.</strong></p></div>

View solution in original post

0 Kudos
Reply
Anatoli
Design Dabbler

Re: Assessment for Nintex Forms with JavaScript included

Jump to solution

Hi kchaluvadi,

thank you for this detailed answer, it seems to be very helpful. For our purposes the SQL query seems to return enough information, as we can join the site name from different data.

I hope the query will return nintex forms attached to content types directly too, in case if the content type is not used, but actually I think this is nice-to-have.

 

I will test it. Thank you again, very appreciated!

Best regards
Anatoli

Reply