Moving a Logic App [to a new tenant]

This happens quite a bit when recycling stuff.

Since there’s not a nice way to export and import Logic Apps as packages (as far as I’m concerned, but feel free to enlighten me), but there’s still a quick workaround for this. Sort of.

Appropriate image from a Logic App

Steps to success:

  1. Create a new Logic App in the destination environment.
  2. In the designer, add the equivalent connections as you’ve used in the source app (i.e. add a SharePoint action, an Automation action etc and connect to these – one of each is enough).
  3. Click Code View on the source app and select all the text from the top until “parameters” at the bottom of the text editor, then copy the selected text. Example of where to stop below, from a project utilizing the SharePoint connector:

"parameters": {
        "$connections": {
            "value": {
                "sharepointonline": {
                    "connectionId": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/RESOURCEGROUPNAME/providers/Microsoft.Web/connections/sharepointonline",
                    "connectionName": "sharepointonline",
                    "id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/providers/Microsoft.Web/locations/norwayeast/managedApis/sharepointonline"
                }
            }
        }
    }

5. Enter Code View on your destination app.

6. Select all the text above “parameters”: { in the same manner as you did when copying. Paste and save.

Voila!

Changing the Search scope in SharePoint

When a customer with tons of sites needs to change the search scope, there are several ways to approach this.

One solution is to create a PnP PowerShell script. In this example we’ll change the search scope to tenant (Organization).

Steps to success:

Export list of sites as a CSV-file
  1. Create a service account with SharePoint Administrator privileges.
  2. Download a list of all the sites on your tenant from the SharePoint admin panel as a CSV-file (Export). If you need to exclude sites, this is the time to do it – remove the sites you don’t want to touch from the downloaded list.
  3. If there are several hundred sites, split your CSV file and do the next step in chunks.
  4. Edit the fields CSVPath, ServiceAccount and TenantName in the script below.
  5. Run the script and login from the service account when prompted.
#Set Parameters
$CSVPath = "./AllSites.csv"
$ServiceAccount = "username@tenantname.no"
$TenantName = "tenantname"

#Fetch sites from the CSV file
$SiteList = Import-CSV $CSVPath

$i = 0;
$TotalRecords = $SiteList.Count

Connect-PnPOnline -Url https://$TenantName-admin.sharepoint.com/ -Interactive
#Iterate through each row from the CSV-file and deploy in script.
try {
ForEach ($Record in $SiteList)
{
$i++;
Write-Progress -activity "Adding Site '$($Record.'Url')'" -status "$i out of $TotalRecords completed"

Set-PnPTenantSite -Identity $Record.'URL' -Owners "$ServiceAccount"
Connect-PnPOnline -Url $Record.'URL' -Interactive

#change default search scope
Set-PnPSearchSettings -SearchScope Tenant -SearchBoxPlaceholderText "Søk her..."
Remove-PnPSiteCollectionAdmin -Owners "$ServiceAccount"
}
}
catch {
	Write-Host "There was an error, see details below:"
	Write-Host $_	//Print the potential errors
}

Drink some coffee and enjoy your new search scope.

Recreating Quick Links Tiles view with Microsoft Lists

My customers have often complained that the Tiles view in the QuickLinks web part isn’t pretty enough. Here is a recreation that uses the SharePoint theme’s colours.

Create a new list with the following additional columns:

Icon (Single line text)
URL (Hyperlink)
Sort (Number, no decimals)
NewTab (Yes/No)

For the icons, use friendly names from https://uifabricicons.azurewebsites.net/

Try it out – it looks quite good!

Create a new Gallery view, and sort it by the Sort column and add the following formatting to the view.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
  "hideColumnHeader": true,
  "hideSelection": true,
  "width": "110",
  "height": "100",
  "formatter": {
    "elmType": "a",
    "style": {
      "text-decoration": "none",
      "display": "inline-block"
    },
    "attributes": {
      "href": "[$URL]",
      "target": "=if([$NewTab] = true, '_blank', '')"
    },
    "children": [
      {
        "elmType": "div",
        "attributes": {
          "class": "ms-bgColor-themeDarkAlt ms-bgColor-themeLighterAlt--hover ms-fontColor-white--hover ms-fontColor-white"
        },
        "style": {
          "display": "flex",
          "flex-wrap": "wrap",
          "min-width": "110px",
          "min-height": "100px",
          "border-radius": "10px"
        },
        "children": [
          {
            "elmType": "div",
            "style": {
              "text-align": "center",
              "margin": "auto"
            },
            "children": [
              {
                "elmType": "div",
                "attributes": {
                  "iconName": "[$Icon]",
                  "class": "ms-fontSize-xxl"
                }
              },
              {
                "elmType": "div",
                "style": {
                  "font-size": "14px"
                },
                "attributes": {
                  "class": "sp-row-title "
                },
                "txtContent": "[$Title]"
              }
            ]
          }
        ]
      }
    ]
  }
}

Obviously inspired by https://github.com/pnp/List-Formatting/tree/master/view-samples/icon-link-tiles

Time flies

Two years since my last update. Sorry! There’s been a lot of new hardware, moved to a new flat, we’re in a pandemic… New tiny home studio; So much gear, so little time. This blog is under a small transformation where I’m adding an IT-section where I’m posting discoverys and some smartness (hopefully). Life goes on, so will my small blog here.

Yes, and I got myself a Moog One!

Replacing shitloads of springs – ARP Odyssey

The keybed sensors needed new springs (and some cleaning).


Replacing over 100 springs takes time. I used leftover springs from a Wersi organ kit which I use for spare parts. Now the keybed feels lile it is brand new. No more double triggering, and you can now finally play two notes at the same time. I love this synth!