Get values from Nintex Repeating Section

Within a Nintex Form and Nintex Workflow, it’s hard to grab out the text for a “Repeating Section”.

For example – this is a FORM value, as a list item column ;

If needing to get the values out, the following steps are needed ;

(1) QueryXML

XPath Query -> //Item

Return Result -> Outer XML

“Query result in” -> QueryResult (collection variable)

“Query first result in” -> IGNORE

(2) Count Items

Collection -> ResultCount (integer variable)

(3) Set Workflow Variable

LoopCount = 0

(4) Loop N Times

Using Variable from (2) above – ResultCount

(5) Get Item From Collection

Collection -> Query Result from step above

Index -> LoopCount

Output -> ItemXML (collection variable)

(6) Do Calculation

LoopCount -> LoopCount + 1

(7) QueryXML

Get the actual values from the XML content

XPath Query -> //_8d761f2d5bd3f96d117be90dc7462142

Return Result -> Text

“Query result in” -> IGNORE

“Query first result in” -> FieldValue (text variable)


Now, you should be able to use the “FieldValue” to build a string of values – from within the REPEATER.

Here’s my sample workflow – with some “LOG” events to show the ItemXML and then FieldValue.

This is what’s shown in the Workflow History ;

Advertisement

Create 200 Test Users in Azure AD (AAD)

In order to try out a few other scripts with many users, I wanted to add a bunch of junk/test users. I found a few AD generator scripts – this one was very helpful ;

https://gallery.technet.microsoft.com/scriptcenter/Dummy-Active-Directory-46883818

But – this needed some updates + tweaks for creating bulk users in AZURE active directory.

I have a sample/dev tenant with Office 365 – and this was able to create 200 users, from an import file with firstname/username.

Have a look at my GitHub Repo ;

https://github.com/kachihro/PowerShell/tree/main/AAD

Find Nintex Forms (Office 365)

As part of a recent migration project, I was needing to find “WHERE” have Nintex Forms been created/used.

For a given SharePoint list, the form is shown immediately when clicking on a “NEW” item. This is the classic old ‘NewForm.aspx’ address – and also ‘EditForm.aspx’ and ‘DispForm.aspx’

But – I couldn’t find how this is being redirected by Nintex, when a Form is published. Neither via PowerShell, or REST API.

Even looking at a SharePoint List from SharePoint Designer !

It turns out that they’re using some settings against the ‘Default Content Type’ for the list – which is “ITEM”.

As seen below, the three magic forms are directing to ‘NFLaunch.aspx’.

So – I’ve created a PowerShell script that does the following ;

  • Input list of Sites
  • Check each SPList
  • Find the first content type – default CT [0]
  • Check to see if the ‘NFLaunch’ is in the form link

Click here to view the entire script, within my GitHub repo ;

https://github.com/kachihro/PowerShell/blob/main/Nintex/FindNintexForms.ps1

.

List all Apps for SharePoint Site Collections (Office 365)

As part of a recent tenant-to-tenant migration, we have been needing to check where (and WHICH) apps were added.

This is mainly for NINTEX – but this script lists other 3rd party and developer apps also.

This includes GROUP sites – as part of an Office365 site, and/or Microsoft Team – as well as the GROUPLESS sites (classic).

$cred = Get-Credential

$orgName = "TENANT" 
$adminUrl = "https://$orgName-admin.sharepoint.com" 
Connect-PnPOnline $adminUrl -Credentials $cred

function ListApps ($url)
{    
   Connect-PnPOnline -Url $url -Credentials $cred    
   $apps = Get-PnPAppInstance
   foreach ($app in $apps)    
   {        
      $logLine = $url + " - " + $app.Title        
      $logLine    
   }
}

#get a list of group sites
$groupSiteCollections = Get-PnPTenantSite -Template GROUP#0
foreach ($sc in $groupSiteCollections) { ListApps $sc.Url }

#get a list of classic sites
$classicSiteCollections = Get-PnPTenantSite 
foreach ($sc in $classicSiteCollections) { ListApps $sc.Url }

This then displays a long list of all site collections – and – APPS ;

https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpappinstance

https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpapp

Nintex Forms Designer Not Loading (Chrome)

I had a weird error this morning when connecting to Nintex Forms – from my SharePoint Office 365 site.   This is within the new (very awesome) Responsive Designer.

The ‘loading’ screen was just waiting, waiting, waiting…

When I clicked on the F12 developer tools – there was a nasty CORS error ;

Access to XMLHttpRequest at [URL] has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.

Here’s a screenshot of the error – and then everything fails downstream.

NF-CORS

It looks like the recent update for GOOGLE CHROME (v76) has changed the setting for CORS.   This is what you need to do >

  • Within Google Chrome – enter this URL
chrome://flags/#out-of-blink-cors
  • Change the setting for CORS to “DISABLED”
  • Restart Google Chrome

That should fix it !   It did for me.    Happy Nintex’ing…

 

Changes for O365 User Group

For many (many) years, I’ve been involved in the committee and leadership of the SharePoint User Group in Melbourne.

But – for 2018 – I’m stepping down from the committee.  

I have a bunch of other commitments, and activities, personally and professionally.    But – first, a quick look back.

MOSSIG

This began with the initial “Melbourne Office Server Special Interest Group” – or MOSSIG – based on the new SharePoint 2007, which was known as MOSS.   

This was around 2006 – almost 12 years ago !

image

Those early years of the user group were held at the Microsoft Office – in Windsor, corner of Toorak + Chapel St.

We then moved to the new Microsoft Office in SouthBank (Freshwater Place) – and – re-branded, with a new logo, and regular newsletter.

We held a launch party for SP2010 – and had stickers made up !

MSPUG

Melbourne SharePoint User Group, then started during the tail end of the SP2010 era – I found a blog post for “goodbye MOSSIG”, from 2011 >

We grew to close to 1000 members over the next few years – and had sponsorship from AvePoint, Micheal Frank (recruitment), Pitcher Partners, Nintex and others…

image

And – we had a “pug” as a mascot – Miss Pug !    (thx Tim…)

image

We used “Event Brite” and “Mail Chimp” for newsletters (spam) – and helped with SharePoint Saturday – and had a user group meetup at TechEd (Gold Coast).

O365 User Group

Then, at the tail end of 2015, we merged with the recently formed Office 365 User Group – and 2018 is our third year.

It’s been great to learn more about the new platform from Microsoft – especially some “infra” perspectives, and lots of Exchange.

Although we spend as much time each month on NEWS as presentations !

We’ve tried different formats with TWO sessions on a few occasions – and have always had pizza, but now we also have BEER !

And held meetings at different venues – but usually based at FreshWater.

Thanks – and see ya !

During the last few months of 2017, I was finding it harder to get along to the user group – and we have new board members that are taking the reins.   

Also, on the home front, we’re starting a house extension – and I’m busy with my KACHIHRO consulting practice – and so I’m stepping away from the board – as of the first February meeting (Feb 25).

I’m really proud of what we’ve achieved over the last decade – with a community of peers, colleagues & competitors – and – lots of wonderful learning, sharing, and chats over beers (Belgian Beer Cafe).

Never say goodbye

I’m stepping down from the committee, but I’ll (hopefully) make it along to the regular monthly meeting !   

And I might even present a session, from time to time.  

Hope to see you there.

So many ppl

There have been a LOT of people that I’ve worked with during MOSSIG, MSPUG + O365UG – from various companies – interestingly, a lot of these folk are now working for Microsoft !

  • Ben Walters
  • William Cornwill
  • Brendan Law
  • Ed Richard
  • Tim Wragg
  • Nathan Gropman
  • Elaine van Bergen
  • Aaron Dinnage
  • David Ross
  • Michael Frank
  • Joel Neff
  • Ashish Trivedi

– and I’ve made so many more wonderful industry friends/buddies –via SharePoint Saturdays, and TechEd’s.

Thanks again – and CHEERS to the rest of the O365UG committee – and the entire Melbourne SharePoint “community”.

Wookie has left the building.    Smile

And so this is Christmas, and what have YOU done ?!

The lyrics of the wonderful John Lennon song are echo’ing in my head, as we close out 2017.

I don’t know about you – but *I* have done a LOT !    It’s been the BIGGEST year ever for Kachihro, and myself – and family also.

It’s now two years since I started out on my own, after ~20 years as an “employee”.   Some great success as a solo-venture – solopreneur is the new cool buzz word.

But – working solo is never a “thing” – I’ve had some great customers, colleagues, and industry friends – chatted over a hundred or more beers, and a thousand or more coffee’s.

“Business is good”

Here are some highlights for 2017 :

  • Kachihro has worked with 16 (!) different customers through out 2017
  • Have achieved over 60% of revenue from the 1/3 of these customers
  • Breakdown of 60/40 for customers as ‘direct’ and ‘sub-contracting’
  • Attended the PauseFest conference in Melbourne – great future thinking
  • Attended the launch of K2-Five and K2-Cloud, in Sydney
  • Left the business behind, while travelling in Europe for three weeks ;
    • Missed out on winning work with two new customers – due to being unavailable – but was a wonderful trip…
  • Completed a great FY2017, according to the ATO, they sent me a bill !
  • Finances & budget have allowed for a new company car 
  • Presented a session at the Digital Workplaces Conference in Sydney
  • Presented a session at the Melbourne Office 365 Saturday
  • Hosted the Office 365 Meetup in Melbourne – don’t forget the Xmas Party this coming Thursday (14th December)

A great roster of customers & projects

There has been a wonderful mix of business verticals – and technologies – to keep me busy through-out the year :

  • Developed/migrated an Office 365 intranet for wonderful team of people, with a company who provides safe & affordable housing for underprivileged, indigenous & homeless people ;
    • I’m very pleased/proud of this project, has been a great success
  • Defined K2 SmartForms and Workflows, as well as Sitrion ONE apps, with SharePoint 2013, for a company providing power tools & home appliances
  • Developed an intranet for SharePoint 2013 (and PoC for Office 365), as part of a large education facility – moving away from an ASP classic + ColdFusion intranet (!)
  • Developed components & provisioning patterns for a number of Office 365 portals, as a consultant for a dynamic and growing team in Collingwood (5p) 
  • Assisted an IT consultancy to merge SharePoint 2010 and Office 365 intranets into a single (new) Office 365 intranet – as part of a company merger
  • Reviewed SharePoint, and then planned & implemented updates to the platform, suffering with large document volumes – to re-architect the solution – for a company providing case management software to councils
  • Updated K2 solution elements for a health care provider, as well as consulted on a new Office 365 intranet, for a custom app developer consultancy
  • Worked remotely with a consulting firm in Hobart, for a new Office 365 intranet for a university, as well as a K2 custom-coded solution for loan approvals
  • Configured & extended an Office 365 intranet for an IT company specialised in container & shipping logistics – fascinating story – Melbourne-grown !
  • Configured Office 365 and Microsoft Teams for a pilot division within an emergency facilities department of Vic Gov
  • Updated an Office 365 intranet for a manufacturing company in Scoresby, providing gaming & cash machines to the global market – another fascinating story – and only 5 mins from my house
  • Updated old legacy VB.NET app for a manufacturing company
  • Created JavaScript libraries for mapping for a new website for a hiking trail in regional Victoria – www.humeandhovelltrack.com.au

*phew*

It’s a great time to be a developer

As well as the project & customer side, it’s been a wonderful year in technology – I love to keep my hands dirty – some great new learning/s :

  • Microsoft Teams – researched, learnt, fiddled & then presented about programming & extending MS-Teams
  • Office 365 – lots of SharePoint, but it’s much more than that !    Branded intranets are still valid, with custom JS, and REST components
  • Microsoft Flow – for list item workflow triggering
  • Azure Functions – for PowerShell and C# for provisioning of Site Collections, initiated by Microsoft Flow !
  • PowerShell – using CSOM and/or Microsoft PnP
  • PowerShell – for deployment of Azure Functions – using Azure RM commands, to create Storage Accounts, Resource Group, etc
  • SharePoint Framework (SPFX) – for new modern-page components – has been a big learning curve, much more than expected – with Yo, Gulp, React, and more
  • ShareGate – for migration to, and management of, Office 365
  • Hyperfish – for maintenance of Office 365 Azure AD identity information
  • Sitrion ONE – for mobility of business processes & intranet comms
  • Lots of great podcasts & information from MS-CloudShow, Azure, O365 Dev, Hyperfish – and many more.

Another year over, and a new one just begun

I’ve been struggling to get through the last few weeks, and I think I’ve worked out WHY….    I’m exhausted !   

I’m very fortunate to have a wonderful family to support me – and great friends to call upon when ‘the cracks are showing’ – and I need a friendly chat.

Next year (2018) is shaping up to be another great year – lots of great new customers & projects kicking off, and commencing an extension to our family home, as well as our eldest son beginning high school !

I need to make sure to stop/think – and keep my head-in-check – and enjoy the ride, on a seemingly run-away roller coaster (sometimes !)

Predictions for 2018

  • Lots more Office 365 – for provisioning, and migration
  • Further learning with SPFX, and React
  • New customers with K2, and Hyperfish
  • Dabble in left-field technologies such as OutSystems

A very Merry Christmas, and a Happy New Year….

Let’s hope it’s a good one, without any fear…

I hope YOU had a fantastic 2017 – with lots of project successes, travels and family fun.    It would be great to work together – if our schedules can align.

Please feel free to contact me directly, for a coffee, lunch or beer….

All the very best wishes from KACHIHRO, for a wonderful 2018,

And – MERRY CHRISTMAS !   

father-christmas_1f385

PowerShell or Command Prompt, Change Folder

For the new breed of SharePoint developers, and using VS-Code for many projects, and even PowerShell, I’m jumping into a command window A LOT these days.

Click the Windows key

Type ‘cmd’ or ‘powershell’

Often, I need to switch over to a specific folder – and type in :

cd “C:\folder\whatever client\project name”

OR – Copy the folder address from Windows Explorer :

image

And then have to paste the address (right-mouse-click) – not forgetting quotes :

image

BUT – there’s a great quick shortcut to this – and it’s AWESOME.

Really.   Awesome.

Within the Windows Explorer bar – just type “PowerShell” (or “cmd”)

Hit ENTER on the keyboard

image

And – you instantly get a PowerShell window – starting in the same folder.image

Same works for CMD – how amazing is that !! 

Smile

Deploy Azure Function, using PowerShell

One of my favourite parts of AZURE is the way you can incorporate a set of PowerShell, in a callable wrapper – or via a Timer – aka, scheduled task.

You can then call this from within a Microsoft Flow – in Office 365 – or have a timer that then awakens, and does something.

My function is simple enough – it logs in to SharePoint, and checks a document library – and then emails a combined reminder list – once a day.

Deploying is easy – when you have access to the Azure tenant – but for a SCRIPTED deployment, I had a bunch of tasks to get through :

  1. Coffee
  2. Create Azure Resource Group – ie. a bucket for all the elements
  3. Create Azure Storage Account
  4. Create Azure Function App
  5. Update some Azure Function App Settings
  6. Upload the Azure Function code (PowerShell)
  7. Upload the MODULE files also
  8. Beer

** I can’t help with step #1 (long black or “Americano”) – or #8 (Sample, or 150 Lashes) – but here’s some tips/code for the other bits.

Smile 

1. Coffee (and login)

Execute the command to connect to Azure – you get a dialog box for username/password :

2. Create Azure Resource Group

image

3. Create Azure Storage Account

image

4. Create Function App

image

5. Update Azure Function Settings

Some of these are necessary for the operation of the Azure Function – others are just CUSTOM for my use/needs – eg. connecting to Office 365 has a User/Password + URL

image

6. Upload Azure Function – from PowerShell file

The contents of the PS1 file are loaded, and the set in the “props” when adding a new Azure Resource – I’m using a timer trigger – you could also do a HTTP trigger.

image

7. Upload the MODULE files for the Azure Function

I used an updated version of the code within this blog post – to push files into the “modules” folder – which is needed for SharePoint Client / CSOM and such.

http://blog.octavie.nl/index.php/2017/03/03/copy-files-to-azure-web-app-with-powershell-and-kudu-api

I have a subfolder called “modules” – with the actual files.    (eg. C:\dev\modules)

image

8. Beer

Well, before we do that – here’s the entire script – using a heap of Azure RM PowerShell functions – you’ll need to install those, if you don’t have them.

Here’s a list of all the commands I’ve used :

  • Get-AzureRmResource
  • Get-AzureRmResourceGroup
  • Get-AzureRmStorageAccountKey
  • Get-PublishingProfileCredentials
  • Invoke-AzureRmResourceAction
  • New-AzureRmResource
  • New-AzureRmResourceGroup
  • New-AzureRmStorageAccount
  • Set-AzureRMWebApp
  • Test-AzureName

Source Code

Hope this works for you – it was a fun process to piece it all together :

$location = ‘Australia Southeast’

$resourceGroupName = ‘rgqwerty’

$storageAccount = ‘saqwerty’

$functionAppName = ‘faqwerty’

$functionName = ‘azurefunctionqwerty’

$SourceFile = ‘sourcefile.ps1’

# =========================================================================

$resourceGroup = Get-AzureRmResourceGroup | Where-Object { $_.ResourceGroupName -eq $resourceGroupName }

if ($resourceGroup -eq $null)

{

New-AzureRmResourceGroup -Name $resourceGroupName -Location $location -force

}

# =========================================================================

if (!(Test-AzureName -Storage $storageAccount))

{

New-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -AccountName $storageAccount -Location $location -SkuName “Standard_LRS”

}

# =========================================================================

$functionAppResource = Get-AzureRmResource | Where-Object { $_.ResourceName -eq $functionAppName -And $_.ResourceType -eq ‘Microsoft.Web/Sites’ }

if ($functionAppResource -eq $null)

{

New-AzureRmResource -ResourceType ‘Microsoft.Web/Sites’ -ResourceName $functionAppName -kind ‘functionapp’ -Location $location -ResourceGroupName $resourceGroupName -Properties @{} -force

}

# =========================================================================

$keys = Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -AccountName $storageAccount

$accountKey = $keys | Where-Object { $_.KeyName -eq “Key1” } | Select Value

$storageAccountConnectionString = ‘DefaultEndpointsProtocol=https;AccountName=’ + $storageAccount + ‘;AccountKey=’ + $accountKey.Value

$AppSettings = @{}

$AppSettings = @{‘AzureWebJobsDashboard’ = $storageAccountConnectionString;

‘AzureWebJobsStorage’ = $storageAccountConnectionString;

‘FUNCTIONS_EXTENSION_VERSION’ = ‘~1’;

‘WEBSITE_CONTENTAZUREFILECONNECTIONSTRING’ = $storageAccountConnectionString;

‘WEBSITE_CONTENTSHARE’ = $storageAccount;

‘CUSTOMSETTING1’ = ‘CustomValue1’;

‘CUSTOMSETTING2’ = ‘CustomValue2’;

‘CUSTOMSETTING3’ = ‘CustomValue3’}

Set-AzureRMWebApp -Name $functionAppName -ResourceGroupName $resourceGroupName -AppSettings $AppSettings

# =========================================================================

$baseResource = Get-AzureRmResource -ExpandProperties | Where-Object { $_.kind -eq ‘functionapp’ -and $_.ResourceType -eq ‘Microsoft.Web/sites’ -and $_.ResourceName -eq $functionAppName }

$SourceFileContent = Get-Content -Raw $SourceFile

$functionFileName = ‘run.ps1’

#schedule – run every 1am every day

$props = @{

config = @{

‘bindings’ = @(

@{

‘name’ = ‘myTimer’

‘type’ = ‘timerTrigger’

‘direction’ = ‘in’

‘schedule’ = ‘0 0 1 * * *’

}

)

}

}

$props.files = @{$functionFileName = “$SourceFileContent”}

$newResourceId = ‘{0}/functions/{1}’ -f $baseResource.ResourceId, $functionName

# now deploy the function itself

New-AzureRmResource -ResourceId $newResourceId -Properties $props -ApiVersion 2015-08-01 -force

# =========================================================================

function Get-PublishingProfileCredentials($resourceGroupName, $webAppName)

{

$resourceType = “Microsoft.Web/sites/config”

$resourceName = “$webAppName/publishingcredentials”

$publishingCredentials = Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType $resourceType

-ResourceName $resourceName -Action list -ApiVersion 2015-08-01 -Force

return $publishingCredentials

}

function Get-KuduApiAuthorisationHeaderValue($resourceGroupName, $webAppName)

{

$publishingCredentials = Get-PublishingProfileCredentials $resourceGroupName $webAppName

return (“Basic {0}” -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes((“{0}:{1}” -f

$publishingCredentials.Properties.PublishingUserName, $publishingCredentials.Properties.PublishingPassword))))

}

function UploadFile($kuduApiAuthorisationToken, $functionAppName, $functionName, $fileName, $localPath )

{

$kuduApiUrl = “https://$functionAppName.scm.azurewebsites.net/api/vfs/site/wwwroot/$functionName/modules/$fileName”

$result = Invoke-RestMethod -Uri $kuduApiUrl `

-Headers @{“Authorization”=$kuduApiAuthorisationToken;”If-Match”=”*”} `

-Method PUT `

-InFile $localPath `

-ContentType “multipart/form-data”

}

# =========================================================================

$accessToken = Get-KuduApiAuthorisationHeaderValue $resourceGroupName $functionAppName

$moduleFiles = Get-ChildItem ‘modules’

$moduleFiles | % {

Write-Host “Uploading $($_.Name) … ” -NoNewline

UploadFile $accessToken $functionAppName $functionName $_.Name $_.FullName

Write-Host -f Green ” [Done]”

}

Change SharePoint Browser Tab Icon – FAVICON using jQuery

Within SharePoint, you can set the “FAVICON” to a specific url within the MASTER PAGE, by updating the HTML markup.

<link rel=”shortcut icon” href=”/_layouts/15/images/favicon.ico?rev=23” type=”image/vnd.microsoft.icon” id=”favicon” />

BUT – what if you don’t want to change the master page ?   

(which, you SHOULDN’T do, for Office 365)

A simple jQuery update will do it :

$(document).ready(function () {
     //change the FAVICON
     $(‘#favicon’).attr(‘href’, ‘/sites/GLOBAL/SiteAssets/IMG/favicon.ico’);
});