CategoriesCreator KitPower AppsPower Platform

Creator Kit – May 2024 Update

Hello! It has been released a new update of Creator Kit. If you’re not familiar with Creator Kit, you can learn more by reading this article before continue reading.

Bug Fixing

Has been fixed some bugs:

  • DetailList : ColHeaderPaddingLeft property does not work
  • Dialog & Panel: All dialogs and side panels in the kit are broken

New Controls

  • Donats Chart
  • Horizontal bar chart
  • Guage chart
  • Stacked bar
  • Masked TextField (Customizable text field)

Considerations

I hope these information can help you…Here you can find official release page on GitHub for this update.

Contact me for questions! Have a nice day!

CategoriesPower AppsPower Platform

Power Apps – Work with JSON

In this article, let’s see how we can work with JSON format in our Canvas App.

What JSON is?

JavaScript Object Notation (JSON) is a lightweight format for exchanging data. It is based on JavaScript syntax, but is language independent and is commonly used for the transmission of structured data.

JSON’s foundation is two structures:

  • A collection of name/value pairs
  • An ordered list of values

These universal structures make JSON versatile across programming paradigms. It represents data as key/value pairs with keys as strings and values as various data types.

Feel free to write me if you need help.

JSON in Canvas App

Incorporate the JSON() function into your applications to seamlessly transform your data into JSON format, and employ the ParseJSON() function to convert a string, provided it is formatted in JSON, into a usable object.

  • JSONDataStructure [, Format ] )
    • DataStructure – Required. The data structure to convert to JSON. Tables, records, and primitive values are supported, arbitrarily nested.
    • Format – Optional. JSONFormat enum value. The default value is JSONFormat.Compact, which doesn’t add newlines or spaces and blocks binary data and unsupported columns.
  • ParseJSONJSONString )
    • JSONString – Required. The JSON structure represented as text.

JSON format example:

{
  "title": "The Lord of the Rings",
  "author": "J.R.R. Tolkien",
  "publication_year": 1954,
  "genre": ["Fantasy", "Adventure"],
  "publisher": {
    "name": "Mondadori",
    "location": "Milan, Italy"
  },
  "price": 20.99,
  "available": true
}

From Data to JSON

Let’s explore how these functions work in Power Apps. First, we’re going to create a collection with random data.

ClearCollect(
    collProducts,
    {
        Title: "Product 1",
        Price: Round(
            Rand() * 100,
            2
        ),
        OnSaleFrom: DateAdd(
            Today(),
            -Rand() * 30,
            TimeUnit.Days
        )
    },
    {
        Title: "Product 2",
        Price: Round(
            Rand() * 100,
            2
        ),
        OnSaleFrom: DateAdd(
            Today(),
            -Rand() * 30,
            TimeUnit.Days
        )
    },
    {
        Title: "Product 3",
        Price: Round(
            Rand() * 100,
            2
        ),
        OnSaleFrom: DateAdd(
            Today(),
            -Rand() * 30,
            TimeUnit.Days
        )
    },
    {
        Title: "Product 4",
        Price: Round(
            Rand() * 100,
            2
        ),
        OnSaleFrom: DateAdd(
            Today(),
            -Rand() * 30,
            TimeUnit.Days
        )
    }
)

And store into variabile in JSON Format:

UpdateContext({ctxJSONData: JSON(collProducts)})

Result:

JSON Test Application - Create JSON

Consider “Format” parameter of JSON formula:

  • JSONFormat.Compact: Output is compact with no added spaces or newlines.
  • JSONFormat.FlattenValueTables: Flatten Power Fx Value tables to JSON friendly arrays.
  • JSONFormat.IndentFour: Output contains newlines and four-space indentation for readability.
  • JSONFormat.IncludeBinaryData: Result includes image, video, and audio-clip columns.
  • JSONFormat.IgnoreBinaryData: Result excludes image, video, or audio-clip columns.
  • JSONFormat.IgnoreUnsupportedTypes: Allows unsupported data types but excludes them from the result.

Keep in mind that if your data includes a type that is not supported, you should utilize the IgnoreUnsupportedTypes option to avoid errors. For a list of supported data types, please consult this resource.

From JSON to Text

Let’s assume that we’ve securely stored our JSON data in our data repository. In this example, I’ll demonstrate how to transfer textual data to a different screen. However, in real-world scenarios, I’ve stored JSON data within a text column on SharePoint. Now, we aim to convert text to JSON to display the record in a table.

Navigate(
    'screen Data',
    Transition.None,
    {data: ctxJSONData}
)

During the “OnVisible” event, our task is to transform JSON text into a structured object. To accomplish this, we need to loop through (using ForAll) each record within our Parsed JSON data, then systematically access fields within the untyped object and cast them into identifiable types.

UpdateContext(
    {
        ctxResult: ForAll(
            ParseJSON(data),
            {
                title: Text(ThisRecord.Title),
                price: Value(ThisRecord.Price),
                OnSaleFrom: DateValue(ThisRecord.OnSaleFrom)
            }
        )
    }
)
From JSON to Table

See official documentations:

How did I use this feature?

I developed a true custom application for a client designed to simplify the management of corporate travel requests. In this scenario, my client is presented with a plethora of options to select when planning a trip. To efficiently manage the many choices, I chose to use a single text field in my database to store a JSON text containing all the selected options. This approach eliminated the need to create more than 25 individual fields. I was able to use this mode since none of these 25 fields were needed for me to thread travel requests.

Considerations

I hope these information can help you! Leave me a comment to let me know what you think, or if you have a better idea to handle this case.

Contact me for questions! Have a nice day!

CategoriesPower AutomateSharePoint Online

Power Automate – Send email from SharePoint Rest Api

Hello, today I want to share with you a method to send emails with Power Automate by using a REST API available in SharePoint. There is a method called “sendMail” in SP.Utilities.Utility that can be used to send emails to users.

Some attention points:

  1. Recipients must be authenticated SharePoint users.
  2. Attachments cannot be included through this API method (You can include inline attachments likes images uploaded in the same SharePoint domain).
  3. It doesn’t send emails to distribution groups or lists.
  4. “To” field must be an array.

Build flow

In this article, I’m going to create a cloud flow that can be run manually. Of course, you can use any trigger that you need, or you can incorporate a SharePoint HTTP request to send an email wherever necessary.

To send mail you should simply add “Send an HTTP request to SharePoint” connector:

Send email with SharePoint http request

So, you must use there parameters:

  • Site address: SharePoint to use to make call
  • Method: POST
  • URI: /_api/SP.Utilities.Utility.SendEmail
  • Headers:
{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}
  • Body:
{  
        'properties': {  
            '__metadata': {  
                'type': 'SP.Utilities.EmailProperties'  
            },  
  
            'To': {  
                'results':[ 'email address']
            },  
            'Body': '<p>Hello Angelo,<br>  
Mail sent from SharePoint Rest Api....<br>
</p>',
            'Subject': 'Say hello!'  
        }  
}

In the body section, you should add “TO” as an object with a result property that accepts an array of email addresses. Similarly, if you want to add “CC” or “BCC“, you can also include “Body“, which can contain HTML, and “Subject” as a string.

This is result:

Email sent from SharePoint rest

Considerations

Some people ask me, “Why should we use this option?” I wrote this article inspired by a recent training course on Power Automate that I delivered for a customer. In this instance, my client needed to send emails, but we didn’t have the option to use a service account to send emails with the standard Outlook 365 connector, and he didn’t want to send them from his email address.

I hope these information can help you.

Contact me for questions! Have a nice day!

CategoriesAIPower AppsPower AutomatePower Platform

Power Apps – ChatGPT Integration

In this article, let’s see how we can integrate ChatGPT with our Canvas App to add AI functionality.

ChatGPT is an artificial intelligence-based chatbot developed by OpenAI, specialized in conversing with human users. The acronym GPT stands for Generative Pre-trained Transformer, which means “pre-trained generative transformer.” With ChatGPT we can, for example, generate content, answer questions, Translate, summarize, complete sentences etc.

Feel free to write me if you need help.

Requirements

Basically, the Idea is call ChatGPT Service via Power Automate, get response and pass it to our App. Before start, you need ensure to have:

  • Premium Licence (Or Trial) to make Http Post request from Power Automate
  • An account with some cretit on OpenAI
  • Valid OpenAI API key

Build flow

In this Example, we’re going to call our flow from a Canvas App, passing a prompt and get an output. Trigger is Standard Power Apps connector:

Power Apps connector as trigger

Then, we must do an HTTP Post request to call OpenAI Service. According to Open AI documentation (at this this link) we need to specify in the following headers to make request:

  • URL: https://api.openai.com/v1/chat/completions
  • Content-Type: application/json
  • Authorization: Bearer $OPENAI_API_KEY

And as Body, a Json with:

  • Model
  • Messages
  • Temperature

Example:

{
     "model": "gpt-3.5-turbo",
     "messages": [{"role": "user", "content": "Say this is a test!"}],
     "temperature": 0.7
   }

In my case I parameterized the prompt, but of course you could also parameterize model or temperature, So, the action to call ChatGPT from flow is:

Call ChatGPT from Http Request

Now, we must get body response, parse it, extract result and pass information back to our app.

Add “Parse Json” action and use this schema (I suggest you do to first call to service and get response and then use “Generate from sample” option):

{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "object": {
            "type": "string"
        },
        "created": {
            "type": "integer"
        },
        "model": {
            "type": "string"
        },
        "choices": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "index": {
                        "type": "integer"
                    },
                    "message": {
                        "type": "object",
                        "properties": {
                            "role": {
                                "type": "string"
                            },
                            "content": {
                                "type": "string"
                            }
                        }
                    },
                    "finish_reason": {
                        "type": "string"
                    }
                },
                "required": [
                    "index",
                    "message",
                    "finish_reason"
                ]
            }
        },
        "usage": {
            "type": "object",
            "properties": {
                "prompt_tokens": {
                    "type": "integer"
                },
                "completion_tokens": {
                    "type": "integer"
                },
                "total_tokens": {
                    "type": "integer"
                }
            }
        }
    }
}

Result:

Parse Json response

And finally, we can get result and pass it to our app. In my case, I used and expression to get first message from result, and pass it to my app:

first(body('ParseResponse')?['choices'])['message']['content']
Pass result to app

Completed flow

The completed flow:

Completed flow

Test from App

Finally, we can create an App to test it. I created a screen with two textbox , firstone for prompt and secondone for output, then I added a button to call our flow and store result in variable.

UpdateContext({ctxChatGPTResponse: ChatGPT.Run(txtChatGPTInput.Text)})

Result:

ChatGPT App

Considerations

I hope these information can help you! Leave me a comment to let me know what you think, or if you have a better idea to handle this case.

Contact me for questions! Have a nice day!

CategoriesPower AutomateUncategorized

My First Article for CODE Magazine!

I am extremely happy and grateful for my first publication for Code Magazine, presented at the Power Platform Conference in Las Vegas 2023. As a Microsoft MVP, I have always dreamt of sharing my passion and knowledge with the tech community. My article, “Using Power Automate to Manage Process” focuses on streamlining business processes with Power Automate. This achievement was the result of dedication and hard work and has given me the opportunity to participate in a prestigious event and expand my professional network. I would like to thank Microsoft, Code Magazine, and everyone who supported me. My commitment as an author and MVP continues, and I hope to share more knowledge and experiences with the tech community. Thank you for your support on this exciting journey.

Code Magazine - October
CategoriesCreator KitPower AppsPower Platform

Creator Kit – July Update

Hello, a new update of Creator Kit is availalbe. If you don’t know what Creator Kit is, you can read my article here.

Bug Fixing

Has benn fixed some bugs:

  • Breadcumbs in Custom Pages, when updates, shrinks
  • SearchBox 1.0.22 “undefined” text inside control
  • Breadcrumb problems with dynamic ItemDisplayName
  • DetailsList TotalRecords doesn’t count correctly
  • PeoplePicker.SelectedPeople JSON parsing error

New Features for Existing Components

  • Details List control – missing event to go to last page

Considerations

I hope these information can help you…Here you can find official release page on GitHub for this update.

Contact me for questions! Have a nice day!

CategoriesPower Automate

Power Automate – Get Action Error Details

In this article, let’s see how you can catch error during flow executions and send information via email. My way to catch error is by incorporating error handling , and track in log table or SharePoint list on you can also send and email with error details. First of all, if you didn’t , you should read my old article “Power Automate – Try Catch”.

Our Flow

Basically, we have a Power Automate flow with manually trigger who catch wheater informations and log them in SharePoint list.

Power Automate Flow without error handling

According, to my old article. Add “Try Catch” scopes. Our flow became:

Simple flow

In this case, my “Catch” scope, is configured to execute only in case of:

  • has failed
  • Is skipped
  • has time out

Basically, now you can add some action to track if your flow going in error and send alert to users. By, let’s do a little additional step, and get error details.

Get errors details

How can we get error details?

In our “Catch” scope, we shuld add “Compose” block to get output result of our “Try” scope, then, we should filter result to extract error details.

Key Point:

Get “Try” scope result, with compose: (you must use “Get result” action)

result('Try')
Get Try result

Now, use “Filter array” action, to filter “Get-Try-Result” result action. In filter, I added this:

item()?['Status']

and filter for “Is Equal” to “Failed”, so final result is:

Filter error in Catch block

Now you can send email with details or track them on list (or both 🙂 ). You can get Action Name, with this expression. To try , I added bool variabile, and set to null in “try” scope.

body('Filter_Result')[0]?['Name']

And error details:

body('Filter_Result')[0]?['Error']

So , final result of “Catch” scope is:

Final result of catch scope with error handling

Final Flow:

Complete flow with error handling.

Finally, in case of error, here is the detail:

Error details

Considerations

I hope these information can help you! Leave me a comment to let me know what you think, or if you have a better idea to handle this case.

Contact me for questions! Have a nice day!

CategoriesDataverseDataverse for TeamsPower Platform

Dataverse for Teams – Formula Columns

Formula columns are a powerful feature of Microsoft Dataverse for Teams. With this data type, you can quickly add a calculated column to your table. This is made possible by the Power Fx, a language that enables you to write formulas and expressions that can be used in Dataverse for Teams.

If you still using it, but you have problem with Data columns, go directly here.

Supported data type:

  • Text
  • Decimal Number
  • Yes/No (boolean)
  • Date

Supported operators:

+, -, *, /, %, ^, in, exactin, &

Create it

Let’s start! Go to edito your Dataverse table, and create create new column:

Create column in Dataverse for teams

Select “Formula” Column. In my Example I want to calculate how old employees are. So:

Formula:

DateDiff('BirthYear ', UTCNow(),TimeUnit.Years)
Create column

Result:

Calculated columns result

Problem with Data column

If you get some error, when using Datacolumn , for Example errors about “Time zone conversion”. You should try to edit your Data column and set “Time Zone Adjustment” property to : “Time zone Indipendent

Time zone Indipendent

Available functions

There are about 54 function available at time I’m writing this article, for Example:

DateDiff, DateAdd , If , UTCNow, Abs ecc…

Here complete lists.

Keep mind this attention point from MS: “The Text and Value functions only work with whole numbers, where no decimal separator is involved. The decimal separator varies across locales. Since formula columns are evaluated without locale knowledge, there’s no way to properly interpret or generate the decimal separator.”

Considerations

I hope these information can help you! Here link to official documentations.

Contact me for questions! Have a nice day!

CategoriesPower AppsPower PlatformUI

Power Apps – Preview an app

Power Apps have now a great feature that allows you to preview your app on different devices and layouts. This is an incredibly useful tool to allows us to test our apps on multiple platforms and make sure that the user experience is consistent across all of them. With this feature, developers can make sure that their apps look great no matter what device or layout they are viewed on.

Press Preview App (F5)

Play App Preview

When you click on option, you can choose Device:

Different layout and devices

Available Options:

  • Tablet Device
  • Mobile Device
  • Web View
  • Orientation Switcher

If you don’t find devices you need, you can put custom Width and Height properties.

App Preview

Enabled Preview

To enable preview, you must enable set authoring version to last one available 3.23053.23 (save and refresh app):

Enable feature

Considerations

I hope these information can help you! If you need more information, you can go here.

Contact me for questions! Have a nice day!

CategoriesDataverseDataverse for TeamsPower Platform

Dataverse – Create Item with Lookup field in Power Automate

Dataverse is a secure platform used for managing and storing data used by business applications. If you’re using Dataverse (or Dataverse for Teams 🙂 ) and your’re trying to creare (or update) row with lookup field, you may can find useful this article.

Initial situation

We have two tables:

  • Customers
  • CustomerContacts

In our table “CustomerContacts” we have two field: Name and Customer, wich is Lookup Column who refers to Customer table.

Tables

I created three record for customer:

Customer table

Table CustomerContracts is empty:

Customer Contacts

Create new customer contact

Let’s assume we need to create through Power Automate (eg for an import from Excel File) our Customer Contacts. How should we do that?

Our Excel File:

Excel File

Let’s see our Flow.

NB: We use “Microsoft Dataverse” actions for both Dataverse and Dataverse for Teams.

Flow with error

This flow don’t need to much explications. We get our Excel File and for each row, we use “Add new row” action to create row. But it doesn’t work. We got this error:

URL was not parsed due to an ODataUnrecognizedPathException. Resource not found for the segment provided in the URL.

We can’t create row using text field (from Excel) in Lookup field.

How can we set Lookup field value?

We need logical name of table and RowId of record we want to refer:

Find internal name of table

Now we can update our flow to use this costruct using Row ID:

cr3e4_customers([ROW_ID])

Or @odata.id directly:

 @odata.id

To get row id, we need get correct items to refer. To do that, we should get logical name of field, before:

Get logical name field.

So our flow become:

Correct flow

In Customer field i wrote:

first(body('List_rows')?['value'])?['@odata.id']

To get first row form “List row actions” (filtered by customer name) and use @data.id value.

Considerations

I hope these information can help you!

Contact me for questions! Have a nice day!

CategoriesPower AppsPower Platform

Power Apps – Modern Controls

If you don’t like standard canvas app control, you can enable this new (experimental) feature to enable a new set of controls , called “Modern Controls”.

NB: This is Experimental Feature, as an experimental feature, do not use it in production apps.

Modern Controls has about 13 new controls wich you can use for your applications:

Modern Controls list
Modern Controls

Enabled Modern Controls

Firs of all, you must enable set authoring version to last one available 3.23034.5 (save and refresh app):

change authorin version image
Enable Named formulas featur

Then, you should find , in experimental features, “Try out the modern controls”:

enable modern controls

Save, refresh and you should see new group of controls called “Modern Controls“.

Considerations

I hope these information can help you! I didn’t find much documentation about it at the moment I’m writing this article, I’ll add some information as soon as I find out 🙂

Contact me for questions! Have a nice day!

CategoriesCreator KitPower AppsPower Platform

Creator Kit – Library Control Errors

At the time of writing this article, when you add Library Component of Creator Kit, you may find some errors. If you don’t know what Creator Kit is, you can read my article here.

Add control to your App

Add one of Library control to your app. If you didn’t have installed Creator Kit in your environment, you can read this article to do it.

Import component
Add Panel Component
Component
Add Control To App

Let’s see how to use this control.

Errors

As you can see, now you have 10 errors on your app. All errors are relative to our Panel Control:

Errors

Our control should look like this:

Error panel in your app
Panel

How to fix it

To fix, you should follow these step:

  • Create a local copy of your control
  • Fix errors
  • Use copied control

Let’s start to create local copy. Click on Edit and then Create Copy:

Edit component
Create copy

Now you have local copy and you can fix errors:

Error panel
Control to fix

In this case (But the errors will change depending on the control you have), I fixed:

Button:

If(ThisItem.ButtonType = Primary, ColorValue(Panel_2.Theme.palette.themePrimary))

To

If(ThisItem.ButtonType = 'Microsoft.CoreControls.Button.ButtonType'.Standard, ColorValue(Panel_2.Theme.palette.themeDark))

Font:

'Segoe UI'

To

Font.'Segoe UI'
Semibold

To

FontWeight.Semibold
Transparent
Color.Transparent

Now your control should work. You should see like this:

Fixex Panel
Panel Control Fixel

We can use our version of control:

Local components

Considerations

I hope these information can help you…Here you can find official documentations on GitHub for this control.

Contact me for questions! Have a nice day!

CategoriesCreator KitPower AppsPower Platform

Creator Kit – Panel Control

Today , we’re introducing one of the “Surface” controls group of Creator Kit: “Panel Control“. Let’s see What is it and how it works. If you don’t know what Creator Kit is, you can read my article here.

Add control to your App

Before use it, you should add it to your app. If you didn’t have installed Creator Kit in your environment, you can read this article to do it.

Add Control to your App
Add Control to your App
Add Panel control
Add Panel Component

Let’s see how to use this control.

Panel Control

This control is usefull to create complex creation, edit, or management experiences of items or settings. Let’s understand how can we use it. When you add it on your app, you should see something this:

Broken Panel Control
Panel

At this time (16/04/2023) when you add Library component of Creator Kit you may find some errors. Use this link to understand how to fix it.

We should set some properties:

Items

Create Table with these attributes:

  • Title– The title of your panel
  • Subtitle– A short description under title
  • DialogWidth– (Default 400) Width of panel
  • Position– (Default Right”) You can write “Left” if you want left panel
  • Visible– True or False, to show or hide panel. I usually use a local variable to show or Hide it
  • Buttons– Table to define buttons of your panel
  • OnButtonSelect– Event to manage select event of your button
  • Theme : Property to set Json theme on controls, as you can see also in others controls of creator Kit. I usually set it when my application starts, and set it on all controls of Creator Kit who support it. You can create your theme here.

Try to put this on OnButtonSelect property:

Switch( Self.SelectedButton.Label,
  "Ok", Notify("Ok button");
);

// Closes the panel
UpdateContext({ showHideDialog: false })

Basically, if you click on “Ok” button, you’ll see Notify in this example and your then panel will hide.

Set “Visible” property:

showHideDialog

So, to show your panel, you must set true “showHideDialog” variable:

UpdateContext({ showHideDialog: true })

How to put controls inside your panel

You can’t put controls inside your Panel control, but you can use a container. Let’s se an example with Vertical container.

To align container to panel, we must set these properies , to same properties of panel:

Container PropertiesPanel Properties
XmyPanel.ContentX
YmyPanel.ContentY
WidthmyPanel.ContentWidth
HeightmyPanel.ContentHeight
VisiblemyPanel.Visible

Just to show you result, I set different background color:

Panel Control

Now you can put others controls inside container and use your panel.

Considerations

I hope these information can help you…Here you can find official documentations for this control.

Contact me for questions! Have a nice day!

CategoriesPower AppsPower Platform

Power Apps – Named Formulas

Today , I want to explain a really cool feature, in order to improve performance of your app and make it “code” more tidier.

NB: This is Experimental Feature, as an experimental feature, do not use named formulas in production apps.

We can use App.OnStart to inizializiate variables, load data and do some operations. These actions my be cause slow starting of your application. Sometimes we use , for example hidden button to write “reusable” code.

Now , we can write formulas and reuse it in any part of our application.

Enabled Named Formulas

Firs of all, you must enable experimental feature. Click on “Settings” and enable it:

Enabled named formulas
Enable Named formulas featur

Use it

Now, you should see new property of your app, called “Formulas”. Here you can add your formula!

Use named formulas
Formulas

Here you can add your formulas. For example:

ParamID = Param("ID");
UserEmail = User().Email;

But, of course, you can add more complex formula.

Advantages

Why we should use named formulas? let’s see some advantages:

  • The formula’s value is always available. There is no timing dependency, no event likes App.OnStart should be executed.
  • Formulas can be calculated in parallel.
  • The formula’s value is always up to date.
  • The formula’s definition is immutable. As opposed to variables, the definition in App.Formulas is the only “source of truth” and the value can’t be changed somewhere else in the app.
  • Calculated when needed. Value are calculated when app need it so this can improve app load time.

Considerations

I hope these information can help you! Here link with additional informations.

Contact me for questions! Have a nice day!

CategoriesPower Platform

Power Platform – Import solution error 0x80040217

Today , I want to explain how to fix Error 0x80040217. If you created custom connector and put it inside solution with for example your flow or your App, may you find in this error, when you try import solution on new Environment:

Error where importing solution with custom connector.

Some note to remember:

  • You have created custom connector
  • You have created app or flow who using your custom connector
  • You have put together in same solution
  • You have exported it from your environment
  • You are trying to import in new environment, but you got and error

How to fix It

Really, really simple!

Create a new solution ed import your custom connector. Then , remove it from previus solutions. Basically, you must import your custom connector before, then import your flows or app that using it.

Considerations

I hope these information can help you!

Contact me for questions! Have a nice day!

CategoriesPower AutomatePower Platform

Power Automate – Restore deleted flows

Today , I want to explain how you can recover deleted Power Automate flows. PS: If you need recover Power Apps, you can read my article here.

Some note to remember:

  • You can’t recover your flow if it was deleted more than 20 days ago
  • You can recover your flow if it was not part of solution (but if did, you can try to open a ticket support)
  • Default state of recovered flow is disabled
  • You can recover flow also with powershell commands
  • You need use Admin user of environment
  • You can write me for comment to improve quality of my contents 🙂

Create flow to recover deleted flow

Let’s build a new “Instant cloud flow” with manually trigger.

Create new flow
Create new instant cloud flow
Create new flow with manually trigger
Create new instant cloud flow

Now we can add some step to recovery our flow, search “Power Automate Management” and looking for step “List Flows as Admin”, then choose correct Environment and set “Include Soft-Deleted Flows” to Yes.

List Flows as Admin
List Flows as Admin

Now have action to list our flows, included deleted flows. Add “Apply to Each” step (I renamed it “ForEachFlow”) in order to iterate our results and then add “condition” action to filter only “deleted” flow by status property:

Filter only deleted flow
Filter only deleted flow

Now last step, add action called “Restore Deleted Flow as Admin” set correct Environment (same as step “List flows as Admin”):

Restore flow  Step
Restore flow Step

and finally run it.

Recover flow
Recover flow

Now , your flow should be appear in list of flow and should be in disabled state:

Restored flow
Restored flow

Considerations

I hope these information can help you to recover your deleted Power Automate Flow…Here you can find official documentation from Microsoft.

Contact me for questions! Have a nice day!

CategoriesCreator KitPower AppsPower Platform

Creator Kit – Nav Control

Today , we’re introducing one of the menu & nav controls group of Creator Kit: “Nav Control“. Let’s see What is it and how it works. If you don’t know what Creator Kit is, you can read my article here.

Add control to your App

Before use it, you should add it to your app. If you didn’t have installed Creator Kit in your environment, you can read this article to do it.

Add Control to your App
Add Control to your App
Add Fluent Nav Control
Add Fluent Nav Control

Let’s see how to use this control.

Nav Control

You can use this control to create a navigation menu in your app. Let’s understand how can we use it. When you add it on your app, you should see something this:

Nav Control
Nav Control

We should set some properties:

Items

Create Table with these attributes:

  • ItemDisplayName – The Display Name of the menu item
  • ItemKey – The key of item (must be unique)
  • ItemEnabled – (Default true) Set to false to disabled
  • ItemVisible – (Default true) Set to false to hide
  • ItemIconName – The Fluent UI icon to use (here you can find icons)
  • ItemIconColor – The color to render the icon as (e.g. named, rgb or hex value)
  • ItemIconOnly – (Default false) set true to hide text label
  • ItemParentKey – Render the option as child item of another option
  • ItemExpanded – Set to false or true if the group should remain collapsed or expanded respectively.

Accourding to documentation, try to put this on Items properties:

Table(
  {
      ItemKey: "1",
      ItemDisplayName: "Home",
      ItemIconName: "Home",
      ItemIconColor: "Green"
  },
  {
      ItemKey: "2",
      ItemDisplayName: "Customer",
      ItemIconName: "People",
      ItemIconColor: "Red"
  },
  {
      ItemKey: "3",
      ItemDisplayName: "Documents",
         ItemIconName: "People",
      ItemIconColor: "Grey"
  },
  {
      ItemKey: "4",
      ItemDisplayName: "Others",
         ItemIconName: "DocumentSet",
      ItemIconColor: "Grey"
  },
  {
      ItemKey: "5",
      ItemDisplayName: "Quick Reference Guide",
      ItemParentKey: "4",
      ItemIconName: "Info",
      ItemIconColor: "Grey"
  }
)

You should see this result:

Nav menu with items
Nav menu with items

OnSelect

You can use OnSelect to get selected item and do some actions like change page. As usual, Just to understand , I show selected item display name in a label:

NavMenu.Selected.ItemDisplayName

Results:

Nav Menu

Others useful properties are:

  • Theme : Property to set Json theme on controls, as you can see also in others controls of creator Kit. I usually set it when my application starts, and set it on all controls of Creator Kit who support it. You can create your theme here.
  • CollapseByDefault: You can set to True or False. Nav remain collapsed or expanded respectively. Individual Item level expand property is respected.

Considerations

I hope these information can help you…Here you can find official documentations on GitHub for this control.

Contact me for questions! Have a nice day!

CategoriesCreator KitPower AppsPower Platform

Creator Kit – November Update

Let’s see what news are introduced with november update of creator kit. If you don’t know what Creator Kit is, you can read my article here.

New Features

Have been introduced 2 new (in preview) components, SubwayNav and SpinButton:

SubwayNav Control

SpinButton Control

Let’s see a basic introduction to use these controls.

SubwayNav

You can use this control to show a wizard steps in our application. Let’s understand how can we use it. When you add it on your app, you should see something this:

SubwayNav control

We should set some properties:

Items

Set a Table , with these attributes:

  • ItemKey: Key of item
  • ItemLabel: A Display Name of item
  • ItemState: Icon of the step, it could be one of: “Current”, “Completed”, “Unsaved”, “ViewedNotCompleted”, “Error” , “WizardComplete”

Accourding to source code, try to put this on Items propertie:

Table(
    {
        ItemKey: "1",
        ItemLabel: "Step 1",
        ItemState: "Current"
    },
    {
        ItemKey: "2",
        ItemLabel: "Step 2",
        ItemState: "Completed"
    },
    {
        ItemKey: "3",
        ItemLabel: "Step 3",
        ItemState: "Unsaved"
    },
    {
        ItemKey: "4",
        ItemLabel: "Step 4",
        ItemState: "ViewedNotCompleted"
    },
    {
        ItemKey: "5",
        ItemLabel: "Step 5",
        ItemState: "Error"
    },
    {
        ItemKey: "6",
        ItemLabel: "Step 6",
        ItemState: "WizardComplete"
    }
)

You should see this result:

Steps

If you don’t want specify ItemState , you can set empty string (ItemState: “”) , and you’ll see an empty white dot.

OnSelect

You can use OnSelect to get selected item and change page to show next step of your wizard. Just to understand , in this case I saved selected step on variable (Is just an example, you can use Controlname.Selected insted):

UpdateContext({SeletectStep: Self.Selected})

And on label:

SeletectStep.ItemLabel

Results:

Other useful properties are:

  • Theme : Property to set Json theme on controls, as you can see also in others controls of creator Kit. I usually set it when my application starts, and set it on all controls of Creator Kit who support it.
  • Subway Nav State: Property to set state on entire controls. You can choose from: “None”, “Errors”, “WizardComplete”
Example of set Subway Nave state property to “WizardComplete”

SpinButton

A spin button is control to allow to add number in small steps. When you add control you should see this:

SpinButton

Principal properties:

  • Label: Usefull to show a label of control.
  • Suffix: To add suffix after value.
  • Theme: As usual, Json theme.
  • Min: Minimal value to set.
  • Max: Maximun value to set.
  • Step: Value to add or Subtracts.

Le’t see an example, I set these properties:

Properties
Results

New Features for Existing Components

About esixting control, have been added:

  • Tooltip for Icon component.
  • DelayOutput for SearchBox component.

Considerations

I hope these information can help you…Here you can find official release page on GitHub for this update.

Contact me for questions! Have a nice day!

CategoriesCreator KitPower AppsPower Platform

Creator Kit – Introduction

Today, we’re going to speak about Creator Kit. With this fantastic tool, we have possibility to create Canvas App, with professional look & feel with “Microsoft 365” Style.

What is “Cretor Kit” ?

According to Microsoft , Creator Kit consist in a series of controls , utility and templates , created to increase developer productivity.

  • All controls are base on Fluent UI Framework , here official documentations.
  • Is included Template Starter apps , to help you to explore components.

Set Up (Manually)

Follow these Steps:

Enable Power App component Framework Feature
Enable the Power Apps component framework feature

Utilization

  • Create new Canvas App
  • Click on Insert to add controls, and click on “Get more components”
Constrols List
Get more components at bottom
  • Now you can choose new component from Creator Kit and add them to your App.
Add new components
Controls of Creator Kit

Now you can see new control on control list under “Code components” group.

Flient Tag List component
Fluent Tag List control inside “Code components” group.

Some intresting components

Creator Kit contains around 24 components. You can start study from here. Most intresting component in my opinion are:

  • AutoWidthLabel is label who expand dynamically his with. You can customize his style by set this properties.
  • CommandBar classic command bar.
Command Bar
  • Nav control control to buil navigations menu for your app.
Nav Control
  • Dialog PopUp to show informations or confirm actions (For example Delete)
Modal PopUp

As I told you, there are more component and more will added every month. I’m going to create a post every month with description on new comonents.

Contact me for questions! Have a nice day!

CategoriesPower AppsPower AutomatePower Platform

Power Platform – Environment

Today, we’re going to speak about Environment. Where people starting to create App or Flow, usually, use Default Environment. But in order to have correct governance or our Power Platform solutions, a good idea (but is not only the one) is create more then one Environment. For Example Dev, Quality and Prod.

What is an “Environment” ?

According to Microsoft , and Environment is a a space to store and share data, app , flows. You can image it as a “Container”.

  • Each environment can have a single Dataverse DB (but you can create environment withoud it)
  • Default environment is Shared by all users, in my opinion you shouldn’t use it to develop critical app.

Environment types

Basically we can create 4 kinds of environment.

  • Sandbox: used for non-production environment but for developing and test. It can be reset or copy.
  • Production: used for permanent work. You need Power Apps license to create and manage it. It will provided with 1 GB database capacity.
  • Trial: used for short term testing. It will be cleaned automatically after 30 days. I usually use it to try new features. It can be create also as subscription based, and it can be conferted as production environment.
  • Developer: you can create a developer plan, follow this one.

Create new Environment

Go to Power Platform admin center: Power Platform admin center (microsoft.com) and click on “New”:

Admin Center
Create new environment

Now you can fill option and create your new environment

Create new environment
Creating

You can find usefull information here.

Contact me for questions! Have a nice day!

CategoriesPower Apps

Power Apps – PDF Function

Hello, really nice fuction under our lens today. “PDF Function”. What is this? Is an Experimental function to print Power Apps Screen as PDF.

Let’s start!

Enable functionality

First of all, you must enable this feature:

Enable PDF Function
Enable experimental feature

How can we use it?

Basically , you should call “PDF” Function and pass it information about screen to “Print” as PDF.

PDF (Screen or control name [,{Size, DPI, Margin, Orientation, ExpandContainers}])

The mandatory parameter is Screen (or control name), but you can specify Size, DPI, Margin etc.. Check documentation here.

Example

Create a form, with “print button”:

Print Screen as PDF
Print screen as PDF
Set(myPDF,JSON(PDF(Screen3))

Now, use PDFViewer control to see result:

See PDF in PDFViewer control
View PDF

Contact me for questions! Have a nice day!

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!

CategoriesPower Apps

Power Apps – Hide navigation bar

Hello, really 30 second to understand how you can hide navigation bar for your app.

Navigation bar

When users click on link you have been shared, probably they see something like this:

App with navigation bar

As you can see, there are:

  • Your app (in this case is mobile app, but is same for tablet layout)
  • Navigation bar (with app launcher, and title of the app)

How to hide navigation bar?

Simply pass link with this query string parameter: &hidenavbar=true

App without navigation bar

Contact me for questions! Have a nice day!

CategoriesMicrosoft 365Power AppsSharePoint Online

Power Apps – Improve performance

Hello, Today I want to explain how to improve performance of yours Canvas App. Any comments, integrations or suggestions are welcome 🙂

Cache local data

Does your data chanche during session of your app? If you reply “No”, you should store your data into local variable and get record from it, instead always ask to database.

ClearCollect(CollProject,Projects_1)

PS: Keep mind delegation problem.

ClearCollect Function more informations here.

You should also cache for user data. Example, if you you email of connected user:

User().Email

Consider:

Set(UserEmail,User().Email)

Optimize OnStart Event – Concurrent

If you create and load collection on “OnStart” event (or on visibile), consider use of Concurrent Function. People tipically write this:

ClearCollect(CollProject,Projects_1);
ClearCollect(CollManager,Manager)

In this case, formula loads each tables one at a time. If you want optimize, you should write this:

Concurrent(
ClearCollect(CollProject,Projects_1),
ClearCollect(CollManager,Manager))

Now your app fetches the tables in parallel.

Use delegations

You shouden’t retrieve all data and then filter locally. Delegate data processing to data source (If is possible). See connectors documentation to learn about delegable formula.

For SharePoint check this link.

SharePoint delegation formula

For SQL Server:

SQL Server Delefation formula
Sql Server Delegation Formula

Use Indexes Column

Simple, but people sometimes forgot to set indexes on column. For SQL Server and SharePoint, check wich columns you’re using to filter, and set Index on these columns.

How to set index on SharePoint columns.

How to set index on SQL Server and Azure SQL.

Replace Defaults() with Variable

When you want to create new record in your table you , tipically you use Default() function. When you use it, there is a call to your datasource …

Defaults(Projects_1)

And Idea is store result of this function on variable, and use it instead call Default() every time:

Set(
    newProject,
    Defaults(Projects_1)
);

Debug – Monitoring Time

If you want to understand what happens “behind the scenes”, you should start a debugging session. From Power Apps portal, select your app and click Monitor:

Monitoring…

Now you can understand durations and respons size of your function to prevent performance issue.

Considerations

Check this official link for other tips .I hope this post was usefull for you.Leave me comment if you has appreciate it.

Contact me for questions! Have a nice day!

CategoriesMicrosoft 365

Outlook Disconnected

Hello, Today not very “tech” article, But maybe usefull 🙂 Yesterday I changed password of my account…and after few hours, I noticed Outlook didn’t receiving any emails… (I updated password anywhere but…). But Previusly it still working…

How to solve it

If your problem , is actually password…A simple way is:

  • Go to Outlook
  • Click of File/Office account
  • Click on “Sigh out”
  • Then re-sign

Others

Clear Cache

If problem persist, you can try clean cache.

  • Windows key+R.
  • In run dialog write: %localappdata%\Microsoft\Outlook
  • Open RoamCache folder
  • Backup your files 🙂
  • Delete all files
  • Start outlook again

Considerations

In my personal case the problem was password Update, but the real problem was that I updated correclty password after change, and Outlook worked correctly. It stopped after2 hours…

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.

CategoriesVarious

New look and feel

Hello guys, I recently update my site with new look and feel. I hope you like it.  It’s more “leaner”, so we can focus on technical informations 🙂

Have a nice day!

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!

CategoriesPower Apps

Power Apps Co-Authoring

New usefull feature! One of Power Apps limitation was we unable to build app more than people a time. Now, we can work togheter!

Enable Co-Authoring

So how can we do that? Really simple, as I usually write into my blog… “One” minute 🙂 I suppose you’re know what is source control and you know github or Azure DevOps. In this case, I’ll you Git repo on my Azure DevOps account. If you don’t know where terms, please read here.

Let’s start!

Create news project on Azure DevOps or git repo. Create or open you existing App , and go to settings, Upcoming Features and go to Experimental tab:

Enable-git-control

Then, enable “Show the Git version control setting”. Then you can see a new Section “Git version control” , click on Connect.

git-control

And configure settings:

git-repo-configuration

Then, it ask you your credentials. Keep mind, if you’re using DevOps, in password sections, you don’t put password, but you must put your personal access token. Now it create folder for you on your git repo and push your source:

powerapp-source-control

Now you can build app with your collegue! It’s experimental but cool!

More info here.

Have a nice day

CategoriesPower Apps

Power Apps – Low code & Low risk

Good news!

Microsoft introduce new way to pay for Power Apps and related services: Pay as you go. From 2/11/21 , you can use your Azure Subcription to cover Power Apps and Dataverse cost, based on usage. In my opionion is very good feature, to allow you to try services with low risk.

See this link:

Low-code with low risk

Have a nice day

CategoriesListsMicrosoft 365SharePoint Online

Microsoft Lists in 1 Minute

What is Microsoft List

Let’s talk about Microsoft List. You can see “List” and others Mmicrosoft 365 App’s. You can use this awesome tool to create list to track informations (Assets, invetory, customers, issues ecc) and collaborate with your team members. If you know SharePoint List’s, this is appear very familiar.

Create new list

Click on the top-left corner:

 

App “Lists” and others Mmicrosoft 365 Apps…

 

 

 

 

 

 

 

 

 

Now you can View and Open your recent Lists or create New List. Click on button   “+ New List”.

Now you have 4 choises:

  1. “Blank list” to create new list from scratch (we do this for this tutorial…)
  2. “Form Excel” to create new list , starting from excel file. It’s good starting point if you have some excel files and want to use List instead of them.
  3. “From existing list” to create list , starting from another list (also from list create inside SharePoint site).
  4. “Templates” if you click on one on template, you can create list starting from it.

Click on “Blank list“, add list Name, description, color, icon,  choose where do you want to save your list (In “My List” or one of your SharePoint sites) and click create.

Customize your list

Now we have our Customer list and we can start to use it. First of all, we need to create some columns. Click on “+ Add Column”

Now you must choose type of date you want to store in this column. Don’t worry if you don’t know what it is it…Ask yourself: “what I want to store in this column? Name of customer? Descriptions? Logo? if the customer is active or now?” This is the key, understand what you need to save. Let’s see common type of column:

  • Single line of text: Simply “text”: Use it for Customer Name or short description.
  • Multiple line of text.:Use it when you want to store more the one text rows…for example descriptions, notes etc.
  • Location: When you neet to track “where”.
  • Number: No description need 🙂
  • Yes/no: Use it if you want to track simply yes or no (Boolean) value. Fors example “is valid customer?” or “Is active customer?”
  • Person:To save People or group in your Microsoft 365 Tenant.
  • Date and Time:  To store date, for example “Expiration date”
  • Choice: To choice value inside a list of value. For example “New customer, Old customer, Inactive”. Or to save status: “Draft, Approved, Rejected”
  • Hyperlink: To save a link.
  • Currency: To store currency value…
  • Image: To store an image such as logo

Keep mind, you have by default “Title” field , in your list. You can rename it.

Now I rename “Title” with “Customer”, and create “Headquarters” and “Acquisitiond date”:

Use your list

Now your list should appear like this:

Now you can click on “New” to add one record a time, or click on “Edit in grid view” to edit it like’s Excel file:

Keep mind, remember to click on “Exit grid view” to save.

I hope it help you..let me know with comment if you want another article on this argumeent. For example how to collaborate with colleague on this list, or how to create rules to send an email when people do something to this list or something else.

CategoriesMS Teams

MS Teams – Reply to

Good news!

Microsoft will realease news feature for MS Teams: “Reply to specific message”. Actually, this feature is available for teams mobile app, but soon also available for desktop version.

See this link:

Microsoft 365 Roadmap 81113

Have a nice day

 

CategoriesMicrosoft 365Power AutomateSharePoint Online

Power Automate – SharePoint Get Items – Filter

Power Automate – SharePoint Get Filtered Items

With this article I want to explain how we can get items with Power Automate (From SharePoint Online) and Filter them.

We have:

  • SharePoint list’s called “Offices” ,with some data:

  • Excel file where we save filtered items. I create and Excel file with same column of list, and store it in OneDrive. Keep mind, you must format sheet as a Table if you want to use it in Power Automate to add rows. 
  • Power Automate flow who get data and put it into Excel File. I used “Get Items” connector to retrieve data from SharePoint list.

Get Items

No Query

We can get data with no query. In this case, you mus put only “Site Adress” and “List Name Parameters”…keep mind “Top Count” parameter and it returs “All” items. I do not suggest this approach (And also Power Automate, who show you a Warning 🙂 )

 

 

 

Filter Query

Best approach, is write a Filter Query to retrieve only items you need. Basically you should write a formula like this: fieldname operation value. 

  • As fieldName you must use iternal field name of SharePoint (Write me a comment if you need a post on this argoument).
  • Operation available are:
    • eq (Equal to)
    • lt (Less Than)
    • gt (Greater Than)
    • ge (Greater than or Equal to)
    • le (Less than or Equal to)
    • ne (No Equal to)
  • Value: value to find, date and string must be inside ‘

We can use also logical operator like “and” and “or

Let’s see some example (I show query and result on Excel sheet):

Filter “eq”

Result:

Filter “lt”

Filter “lt”

Result:

Filter Query with Functions

You can also use functions for your filter query.

  • endswith
  • startswith
  • substringof
  • ….

The syntax is: functions(fieldName, value)

An Example:

Result:

I hope it help you

CategoriesLicensingMicrosoft 365

Microsoft 365 – New Pricing

Microsoft Announces New Pricing for Microsoft 365

After about 10 years , Microsoft will update Microsoft 365 licensing cost. All informations here

Quick recap:

Since Office 365 was launched, Microsoft released:

  • 24 apps (for example Microsoft Teams, Power Apps, Power BI, Power Automate, Stream, Planner etc…)
  • Over 1,400 features
  • AI and automations feature and tools
  • more…. (Read full article)

Price:

  • Microsoft 365 Business Basic (from $5 to $6 per user)
  • Microsoft 365 Business Premium (from $20 to $22)
  • Office 365 E1 (from $8 to $10)
  • Office 365 E3 (from $20 to $23)
  • Office 365 E5 (from $35 to $38)
  • Microsoft 365 E3 (from $32 to $36)

New pricing will start on March 1, 2022

Read full article for more informations.

I hope it help you…Have a good 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.

CategoriesSharePoint Online

SPO Parent/Child relationship

Hi, here’s to know “How can we create relationship” beetwen two SharePoint Online lists.

My idea is create relation with a list of costs rows, to my list “Travel requests”, created for previous tutorial (Build an app in a few minutes), to understand costs details for each travel 🙂

1. Create list “Expense rows”

As a first step, we need a new list to store costs rows, so I add new list to my SPO site.

Then, we should add column to store amount of cost and column to create relationship with travel rows (PS: I use Title column for title of cost row)

Ok now we must create column to create relationship beetwen cost row and travel. To do this, need a LookUp column or for Italian People (“Ricerca”). Please keep mind this kind of column doesnt’t listed on list of common type column (see previous screenshot). One way to create it: click on “Add column” , “More” .

Here we can create lookup column.

Put column name (my case “Travel”) and choose type “Lookup”… (Wait for page reload).

Now you should set “Get information from” field : In this field you must choose another list where get row (or multiple rows) to create relationship.

Set “In this column” field. Here you can set column of other list, used to choose row.

In my case I also checked “Require that this column contains information“, because , in my opinion, when we add cost rows, travel is mandatory 🙂

There are others option, but for this tutorial we can click ok, and come back to our list.

2. Show relationship in SPO Page

First, create some travel rows and cost rows. Now , when we add some cost rows, we must choose “travel” row to associate it 🙂

Adding cost row

Now it simple 🙂 To show relationship beetwen two list, we must edit a SharePoint page, add two “list” webpart:

Select Parent list first:

And then we do same process for expense rows.

Finally we have 2 lists in page:

All lists data in page

Finally, add Dynamic filtering on “Expense row” webpart:

Result:

Thanks and Stay tuned 🙂

CategoriesPower AppsSharePoint Online

Build an app in a few minutes

There are two ways to build an app with Power Apps. “Canvas App” (My favourite) and “Model-driven app”. In this article , let’s see how we can build an app in less then ten minutes with Canvas App, starting from data.

The fastest way

1. Start from data

We should start from data using one of connectors available, such as Excel, SQL Server, Dataverse or SharePoint.

For this article, I created a SharePoint list , starting from template “Travel requests”. The Idea is create a mobile app to allow users create travel requests.

2. Build App

Let’s build 🙂 Go to https://make.powerapps.com/ , login with our account, on “Start on data”, click on “SharePoint”:

Then, choose “Connect Directly” (In my case , I use a list on SharePoint Online):

 

Click on “Create” button, and put url of SPO Site who host our list:

Click “Go” , then choose the list, click “connect” and wait….

Now? we have our app , ready to use or customize!

Our App, is ready to use with Add, edit, delete and search functions.

I spent more time to write this article then create app 🙂

In my opinion, this is the fastest way to create a Power Apps, If you don’t like it, you can use it as starting point to learn how to build and app, or to create a poc for your users or customer.

CategoriesPower Apps

Power Apps Introduction’s

Customer’s often ask me: “What is Power Apps? What can I do with it?

“Official” reply is : “Power Apps is a suite of apps, services, connectors and data platform that provides a rapid application development environment to build custom apps for your business needs. Using Power Apps, you can quickly build custom business apps that connect to your business data….” (Here official link)

In order to make it easier to understand, my reply is:

“With Power Apps, you can build applications without being developers, integrated with different services, usable through browsers, tablets and Android or iOS Smartphones.”

Mixed-Reality-Power-Apps

Does It appear cool? Yes it do 🙂

There are many other things you can do… for example the features of Mixed Reality, or AI Builder that allows you to take advantage of artificial intelligence to extract text from an image, perform sentiment analysis, process receipts etc…

I’ll write a series of tutorials that will bring you closer to this world with very little effort.

See you soon. Stay tuney!

CategoriesVarious

Welcome to my blog!

Hi! I decided to open this blog to share my knowledge. I’ll shortly publish the first articles. Visit the “Who I am” page to know me better.

The thematic areas of my articles will mainly concern Microsoft technologies, with a focus on SharePoint and Power Platform.

Stay tuned!

Angelo

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