CategoriesMicrosoft 365SharePointSharePoint Online

SharePoint – Team Site without Microsoft 365 Group

Hello, here really simple post to explain how to create a SharePoint site without Microsoft 365 group associated.

Create Site

Follow there instructions:

Clicck on App Launcher and then on “Admin”. Then click on “Expand all” , SharePoint and “Active sites”

Then we can create site:

Click on Create and “Other options”:

Now we can create our site:

Considerations

Why we should create site with no M365 group? If we don’t need Outlook, planner or Teams associated but just need a SharePoint Team Site. Just to remind…to do that, we should be are SharePoint Administrator.

Contact me for questions! Have a nice day!

CategoriesMicrosoft 365SharePoint Online

SPO – JSON form custom formatting

Hello, Today we spoke (write 🙂 )about SharePoint list form customization. Basically, we have two way to customize existing form:

  • JSON Formatting
  • Edit form with Power Apps

We try to Explain how to customize form formatting with Json.

Format Form

Go to your list, and click on New, click on the top right Edit form icon, e click on “Configure layout”.

Basically We can write some JSON to format these sections:

  • Header
  • Body
  • Footer

Header customization

Choose “Header”. How can we customize it?

We can start from official MS Docs , copy header JSON code and try it:

{
    "elmType": "div",
    "attributes": {
        "class": "ms-borderColor-neutralTertiary"
    },
    "style": {
        "width": "99%",
        "border-top-width": "0px",
        "border-bottom-width": "1px",
        "border-left-width": "0px",
        "border-right-width": "0px",
        "border-style": "solid",
        "margin-bottom": "16px"
    },
    "children": [
        {
            "elmType": "div",
            "style": {
                "display": "flex",
                "box-sizing": "border-box",
                "align-items": "center"
            },
            "children": [
                {
                    "elmType": "div",
                    "attributes": {
                        "iconName": "Group",
                        "class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-themePrimary",
                        "title": "Details"
                    },
                    "style": {
                        "flex": "none",
                        "padding": "0px",
                        "padding-left": "0px",
                        "height": "36px"
                    }
                }
            ]
        },
        {
            "elmType": "div",
            "attributes": {
                "class": "ms-fontColor-neutralSecondary ms-fontWeight-bold ms-fontSize-24"
            },
            "style": {
                "box-sizing": "border-box",
                "width": "100%",
                "text-align": "left",
                "padding": "21px 12px",
                "overflow": "hidden"
            },
            "children": [
                {
                    "elmType": "div",
                    "txtContent": "='Contact details for ' + [$Title]"
                }
            ]
        }
    ]
}

So , now we can see result.

Before:

Before

After:

After

How to edit?

Basically, our JSON going to apply style to these section:

{
    "elmType": "div",
    "attributes": {
        "class": "ms-borderColor-neutralTertiary"
    },
    "style": {
        "width": "99%",
        "border-top-width": "0px",
        "border-bottom-width": "1px",
        "border-left-width": "0px",
        "border-right-width": "0px",
        "border-style": "solid",
        "margin-bottom": "16px"
    },

Element:

 "elmType": "div",
    "attributes": {
        "class": "ms-borderColor-neutralTertiary"
    },

Style

  },
    "style": {
        "width": "99%",
        "border-top-width": "0px",
        "border-bottom-width": "1px",
        "border-left-width": "0px",
        "border-right-width": "0px",
        "border-style": "solid",
        "margin-bottom": "16px"
    },

Some people asking me, “How can I find witch section I’m modifing? I’m not expert” , an Idea is : Add background color red to style to indentify section:

Before
After

Not beautiful to see, but simple to identify 🙂

Body customization

To customize Body, you should simply define Sections and fields, in my case:

{
    "sections": [
        {
            "displayname": "Basic information",
            "fields": [
                "Title",
                "Description"
            ]
        },
        {
            "displayname": "Worfkflow status",
            "fields": [
                "Step"
            ]
        },
        {
            "displayname": "Other",
            "fields": [
                "Attachments"
            ]
        }
    ]
}

Footer Customization

Now the last part, footer. Similar to header, we can write JSON for a part to customize

{
    "elmType": "div",
    "style": {
        "width": "100%",
        "text-align": "left",
        "overflow": "hidden",
        "border-top-width": "1px"
    },
    "children": [
        {
            "elmType": "div",
            "style": {
                "width": "100%",
                "padding-top": "10px",
                "height": "24px"
            },
            "children": [
                {
                    "elmType": "a",
                    "txtContent": "='This is footer section! ' + [$Title]",
                    "attributes": {
                        "target": "_blank",
                        "href": "='https://aka.ms/contacts?email=' + [$Title]",
                        "class": "ms-fontColor-themePrimary ms-borderColor-themePrimary ms-fontWeight-semibold ms-fontSize-m ms-fontColor-neutralSecondary–hover ms-bgColor-themeLight–hover"
                    }
                }
            ]
        }
    ]
}

As you can see , you can also use field of the record , in our example title: [$Title].

Before

References & info

Syntax

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-reference

Advanced formatting concepts

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-advanced

Where you can find icons name

https://developer.microsoft.com/en-us/fluentui#/styles/web/icons

Column formatting

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#creating-custom-json

Considerations

This is one way. Another option is modify form with Power Apps, let me know if you want an article to understand how.

Contact me for questions! Have a nice day!

CategoriesSharePointSharePoint Online

SharePoint Online – Get alert on documents changes

Hello, This is one of a series of post where I want to help you to improve your experience with SharePoint Online. This article,I’ll explane how you can ask to SPO to inform you whene anyone makes change to your documents.

Document Library

We have SharePoint site, and a document library called “Docs” where we collaborate with our collegues (PS: Do you know Co authoring? See this link)

SharePoint Document Librart
Simple SharePoint Document Library

Basically We don’t want go every day on our document library to check if our collegues has make change on documents…So how can SharePoint help us?

Alerting

Simple ,As I usually try to explain…:-) One way is configure an Alert on Document Library (Or Lists). Go to your DL, and looking for “Alert Me” on Ribbon:

SharePoint Alert me option
Document Library – Alert Me

Next Page page ask us a series of parameters to configure Alert. In Order:

  • Title: Title of the Alert (also included in subject mail).
  • Send Alert To: People to receives alert.
  • Delivery method: Choose if you want receive mail or SMS.ù
  • Change type: Very important. The changes typology that trigger the alert. For Example Item modified, or Deleted.
  • Send Alerts for These Changes: Useful to restrict alert, for example you can get alert only for document created by you.
  • When to Send Alerts: How frequently you want to be alerted? My suggestion , generally, is Daily recap to limits numers of mails.
SharePoint Alert me page
Configure Alert Options

Considerations

This is really simple way. Another option is create a Power Automate flow with appropriate trigger. I hope this is usefull for you.

Contact me for questions! Have a nice day!

CategoriesListsMicrosoft 365Power Apps

Power Apps – Patch function

Hello, new Post Today. We’re going to understand how to use Patch function with SharePoint list. For this Example I used a “Task List” who contains text , choose , lookup and numeric columns.

Let’s see “Patch” Function.

Syntax

Patch( DataSource, BaseRecord , ChangeRecord1 ,ChangeRecord2,…)

Parameters:

  • Data source: the data source who contains your records. In our case is our SharePoint list.
  • BaseRecord : the record to update or use Defaults to create new one.
  • ChangeRecord(s): one or more record who contains properties to modify.

Pills:

  • You can use Patch tu create new record or update existing record.
  • Patch will update only specified properties, other will ignored.

Example

Here our task list:

Task list image

Create new record:

Patch(
    Tasks,
    Defaults(Tasks),
    {
        Title: "New Task",
        Description: "Our task descriptions",
        Status: {Value: "New"},
        Project: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
            Id: 1,
            Value: "Project 1"
        },
        ProjectID:1000
    }
)

Key points:

  • Title and Descriptions are text field, so we should pass text value. Same for ProjectID who is Number and we must pass numeric value.
  • For Choose value, function expect record: {Value: “New”}
  • For Lookup column, we must pass record with ‘@odata.type’, Id and Value:
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
            Id: 1,
            Value: "Project 1"
        }

That’s all! If we want to update an existing record? You must get it and pass to patch function instead Defaults(). In this case, I used Lookup function to retrieve record to update:

LookUp(Tasks,ID=4)

So, complete code is:

Patch(
    Tasks,
    LookUp(Tasks,ID=4),
    {
        Title: "Old Task",
        Description: "Our task descriptions",
        Status: {Value: "New"},
        Project: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
            Id: 1,
            Value: "Project 1"
        },
        ProjectID:2000
    }
)

This is the official link of patch function.

I hope this post should help you.

CategoriesMicrosoft 365SharePoint Framework

SPFx Failed to load component for guest users

If you’ve ever developed a custom Web Part for SharePoint, and “Failed to load components” message occures for guest users, here you can find possibile solution to fix it.

SPFx Failed to load component guest users

I develop a SPO Webpart…it run correctly but when my customer share site with guest user, it give us and error:

Something like this:

[SPLoaderError.loadComponentError]:

***Failed to load component "12345-c123-a1be27-223a-xxxx0" (MyWebpart Name).

Possible fix path

A possible problem is guest users can’t acess to ClientSideAssets library on AppCatalog site, so one way is:

  • Enable external sharing on AppCatalog site
  • Break permissions on ClientSideAssets library and give reading permission for guest users

If don’t work, you can try also to restore inherits permission and put guest users inside readers group of app catalog site. In this case, guest can Access to all site resources as reader, but if it work you can continue investigate on problem.

Have a nice day

CategoriesMicrosoft 365Power Automate

Power Automate – Get items – Filter by lookup columns

Today, let’s understand how to filter SharePoint Items, by lookup column, from Power Automate flow.

FILTER BY LOOKUP COLUMN

In this Example, I created two lists: Projects and Tasks. Every tasks has lookup to project.

filter-by-lookup-projectlist

And Tasks:

tasks

As we can see , we have “Project” column. This is our lookup column.

Create a flow

To to this example I create a Simple flow wiht manually trigger (keep mind…this is just an example…). My flow has one Actions (“Get Items”). Let’s see how to filter task by Project. One way is filter by title column of lookup (In this case I used Title). Another options is filter by Lookup ID.

Code to copy, filter by Value

InternalFieldName/Title eq ‘Lookup Value’

Or, filter by

internalFieldName/Id eq ‘Lookup Id’

Let’s see our flow:

get-items-lookupfilter

Result: It get me one task, associated with “Project 1” .

lookup-filter-result

Have a nice day!

If you want to understand , in general, how to filter Items in Power Automate, click this link.

CategoriesMicrosoft 365Power Apps

Power Apps – Query String Parameter

Let’s learn how can we passing parameter to our Canvas Apps.

QUERY STRING PARAMETER

In this Example, I built a simple app to write a ticket in SharePoint List. In this case , I need to pass (from “external”) a parameter to our App, to set Ticket Type. My choose are:

  • Infrastructure
  • Software
  • Services

To achievement this, we should use “Query String” and Param Function. Query String is part of url , used to passing data to application.

Step 1 – Get query string from App

To get query string, I used param function in OnVisible event of my Screen to get date and store it on local variable. I can’t use “On Start” event of app because UpdateContext is only available while you are currently on a screen. When the OnStart code is executed no screen has loaded yet.

Code to copy:

If(
Param(“TicketType”) <> Blank(),
UpdateContext({selectedTicketType: Param(“TicketType”)}),
UpdateContext({selectedTicketType: “Infrastructure”})
);

Step 2 – Set Default Value to control

In my Example, I used a Form with SharePooint list as Datasource . My field “Ticket Type” is Choose field. To set value as default, I set Default property of datacard, only if the form is in “insert mode”. Why? because if we are in view or in edit, we need to see data of item, not our parameter. So:

Code to copy:

If(
frmCreateTicket.Mode = FormMode.New,
{
‘@odata.type’: “#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference”,
Id: 0,
Value: selectedTicketType
},
ThisItem.TicketType
)

Finally

You should call your app with query string, in my case:

https://apps.powerapps.com/play/xxx-xxx-xxx-xxx?tenantId=xxxx-xxx-xxx-xxxx&TicketType=Services

(xxxx are guid of your app and tenant id, you see it when you run an app in browser)

Have a nice day!

CategoriesPowerShellSharePoint Online

Connect-SPOService-is-not-recognized

The term ‘Connect-SPOService’ is not recognized as the name of a cmdlet

If you’re trying to execute powershell script and you got this message, you need to install SPO Management Shell and import the module.

Execute this script (as Admin)

Install-Module Microsoft.Online.SharePoint.PowerShell -Force

Now, you can try to connect:

Connect-SPOService -url https://yourorganization-admin.sharepoint.com

Could not load type Microsoft.SharePoint.Administration.DesignPackageType

If you get this error (It was my problem), you can try solve it following these steps:

  1. From Windows Control Panel, uninstall “SharePoint Client Components”
  2. Execute (Admin mode) Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell -AllVersions -Force
  3. Execute (Admin mode) Install-Module Microsoft.Online.SharePoint.PowerShell -Force

I hope it help you…Have a good day!

CategoriesPower AppsPowerShell

Restore deleted App

Did you deleted your App 🙂 ?

Don’t worry, in the most of case you can recover it. Let’s see how, with simple powershell command. As I usually write, if you know what you do , the script is:

Get-AdminRecoverDeletedPowerApp -EnvironmentName ‘Default-abcd1234-abcd1234-abcd1234’  -AppName ‘abcd1234-abcd1234-abcd1234-abcd1234-abcd1234’

Step to do it:

  1. Install these PowerShell Modules (You must be admin of PC):
    • Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
    • Install-Module -Name Microsoft.PowerApps.PowerShell
  2. Find Environment Name:
    • Get-PowerAppEnvironment (You can get it also from url…)
  3. Find deleted App Name
    • Get-AdminDeletedPowerAppsList -EnvironmentName Default-abcd1234-abcd1234-abcd1234

Now, you can restore your app:

  1. Add-PowerAppsAccount (It open prompt to get credentials)
  2. Get-AdminRecoverDeletedPowerApp -EnvironmentName ‘Default-abcd1234-abcd1234-abcd1234’  -AppName ‘abcd1234-abcd1234-abcd1234-abcd1234-abcd1234’

I hope it help you…Have a good day!

CategoriesPower Automate

Power Automate – Try Catch

Hi, Today I want to explain how to implement “try-catch” (and “Finally” also if you need). It’s very simple…basically you should add “scope” , put actions inside, add another “scope” to manage error…let me show:

1) Add “Main” scope with your actions inside:

2) Add another scope. I called it “Catch” …it contains some actions to execute if  error in “Main” scope should occur:

Now, we must configure “Run after” on this scope to execute it in case of error:

If you want , you can add also “Finally” scope to execute some actions in any case…your flow should be appears like this:

That’s all! Personally I use these scope to write log in case of error and success also.

Thanks

CategoriesPower Apps

Power Apps – Date of week

Hi! let’s see a simple way to show name of day of week. There isn’t “built in function” get name, but we can use Weekday(Date) function to get numer of day and use it to show name:

Switch(
Weekday(Now()),
1, “Sunday”,
2, “Monday”,
3, “Tuesday”,
4, “Wednesday”,
5, “Thursday”,
6, “Friday”,
7, “Saturday”
)

You can change Today() with your date and get name of week.

I hope it help you…Have a good day!

CategoriesPower AppsPowerShell

Change App Owner

Let’s see how to change Power App owner.

Actually there is no possible to change it from UI. You can only add a Co-Owner user.

Fortunately we can do it with a simple PowerShell command:

Set-AdminPowerAppOwner -AppName ‘abcd1234-abcd1234-abcd1234-abcd1234-abcd1234’ -AppOwner ‘abcd1234-abcd1234-abcd1234’ -EnvironmentName ‘Default-abcd1234-abcd1234-abcd1234’

Step to do it:

  1. Install these PowerShell Modules (You must be admin of PC):
    • Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
    • Install-Module -Name Microsoft.PowerApps.PowerShell
  2. Find Environment Name:
    • Get-PowerAppEnvironment
  3. Find App Name
    • Get-PowerApp ‘Name of your PowerApp’
  4. Get UserID
    • Personally I take it from Azure AD

Now, you can change Owner:

  1. Add-PowerAppsAccount (It open prompt to get credentials)
  2. Set-AdminPowerAppOwner -AppName ‘abcd1234-abcd1234-abcd1234-abcd1234-abcd1234’ -AppOwner ‘abcd1234-abcd1234-abcd1234’ -EnvironmentName ‘Default-abcd1234-abcd1234-abcd1234’

 

I hope it help you…Have a good day!

CategoriesExcelSharePoint Online

SPO Lists VS Excel File

“Are SharePoint Lists better then Excel Files?” or “Why shloud I use a SharePoint list intead Excel Files?”

These are 2 of the most asked question of my customers/students.

First of all, in my opinion there isn’t  “best technology” or best “solutions” for all problems. There is more appropriate solution for your problem (or budget 🙂 ), so the “key” is: know different options to choose the most appropriate.

With these premises, let’s me explain some reasons why, personally, generally I prefer SPO List, intead Excel files.

  1. List item versioning. SharePoint can store N versions on your list item, so you can see differents beetwneen versiones and restore previus version of item. Isn’t this cool?
  2. Set item level permissions. You can decide , for each list item, who can see or edit it.
  3. Different views. You can create different views of list. Users can create personal view with filters ,group or sort by columns.
  4. Save author, last modified user, created date , last edit date. Automatically, for each rows. 
  5. Better integration with Power Automate & Power Apps, so your simple list becomes part of business process.

Have a good day!

CategoriesPower Apps

Try Power Apps – Free

If you want, you can try Microsoft Power Apps for free!

As usually…it very simple:

Open this url:

Power Apps – Developer Plan

You will get following benefits:

  •  Create & test unlimited apps, with premium connectors and dataverse also
  • You can use Power Automate
  •  You can create more then one environments

All informations here:

Details

That’s all.

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

CategoriesPower Apps

Power Apps – Open External URL

How can we open external URL in Power Apps? for example another app or site?

Very simple:

“Launch” function. It need url as first (mandatory parameter) and if you need, you can also add parameters.

Example:

Launch( “https://powerapps.microsoft.com/it-it/blog/” )

Or if you need to pass parameters, one way is:

Launch( “https://www.google.com/search?”; { q: “powerapps” } )

That’s all.

My Agile Privacy
This website uses technical and profiling cookies. Clicking on "Accept" authorises all profiling cookies. Clicking on "Refuse" or the X will refuse all profiling cookies. By clicking on "Customise" you can select which profiling cookies to activate.
Warning: some page functionalities could not work due to your privacy choices