Vue lecture

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
✇Norm Young

Migrate Microsoft Lists to Dataverse for Teams

Despite this blog post’s catchy title there is no magic upgrade button to move Microsoft Lists to Dataverse for Teams. There may be in the future but until then migration translates to rebuild. A list rebuild to Dataverse will most likely be caused by a design requirement that Lists is not suited to, like setting up complex table relationships or custom security configurations in the data. In this post I am redesigning my list to have a more normalized structure. I am using a customized version of the Microsoft Lists Issue Tracker template in this demo and will split the list into multiple tables. The Issue Tacker list structure lends itself to capturing process transactions. The Issue Source column stores the related apps and services that might have issues that need tracking. Moving Issue Source to a related table allows us to add more metadata about the source like person responsible, standardizes data entry and makes for a better user experience by moving away from manual data entry to a lookup experience. In a relational design view Issue Source will have a 1-to-many relationship to the Issue Tracker table. 

To get started with our list migration connect to Microsoft Teams, click More added apps and then select Power Apps

Add Power Apps to Microsoft Teams

Click Start now on the How to create an app for your team screen.

 How to create an app for your team screen

Select your target team and then click Create

Select your target team and then click Create. 

Power Apps will create the Dataverse for Teams database and send you an email when complete. After the provisioning is complete you are prompted to supply an app name in the Power Apps Teams maker experience. Enter an app name and click Save

Enter an app name and Save.

We will create our new tables, Source and Issue Tracker , by clicking on With data on the Start this screen form.

Start this screen With Data

Our Source table has a 1-to-many relationship with the Issue Tracker table, this means we should build Source first. Enter a table name and click Create. Notice that Dataverse tables names are usually named in singular form and then given a plural name within the create table experience.

Create a table experience

We can add columns to our table by clicking the Add column button. I like to add an “ID” column to all of my tables using the Auto number column type with a string prefix. If the Name value changes in the table, I can supply data continuity through the ID column. To create the column, click Add column and set: 

  • Name to “Source ID” 
  • Type to “Auto number” 
  • Autonumber type to “String prefixed number” 
  • Prefix to “SRC”, this can be any value but should reflect the table name in some form 
  • Minimum number of digits to “4”, this value should reflect the max number of entries you expect in this table 
  • Seed value to “1000”, this can be any value and in is usually influenced by a business requirement 
  • Max length to “100”, this value should reflect the max number of entries you expect in this table 
  • Click Create 
  • Source ID column definition
  • Populated Source ID column.

The Source table will include a service owner column. Unlike Microsoft Lists there is no Person column, and we will use the Email column instead. Click Close when complete to save the table changes and return back to Power Apps.  

Owner column using the email column type.

Our next step is to create the Issue Tracker table. 

 Add the following columns shown below: 

Column nameColumn type
Issue IDAuto number with: 
– Autonumber type set to “String prefixed number” 
Prefix set to “ISS” 
Minimum number of digits to “4” 
Seed vale set to 1,000 
Max length to 100 
Folder LocationURL with max length 255 
Issue DescriptionText with max length 1,000 
PriorityChoice with the following choices: Critical, High, Normal, Low 
StatusChoice with the following choices: Blocked, In progress, Completed, Duplicate, By design, Won’t fix, New 
Assigned ToEmail with max length 100 
Date ReportedDate with default options 
Due DateDate with default options 
Days OldNumber with default options 
Issue SourceLookup with related table set to Source 

Column creation images are shown below. 

  • Issue ID column using Autonumber`
  • Folder Location column using URL column type
  • Issue Description column using the Text column type
  • Priority column using the Choice column type
  • Date Reported column using the date column type
  • Issue Source column using the Lookup related table column type

Click Close when complete to save the table changes and return back to Power Apps. 

Back in Power Apps, click With data in the Start this screen and select “Issues” to build our starter app. 

Start this screen with data

Our starter app looks good but requires a few modifications to make it work for our design. 

Power Apps starter app

Click EditForm1 and then click Fields. 

Editing the form in our starter app

We will add the Issue Source column to our form by clicking Issue Source and then click Add. Use the Columns and Layout controls to layout the form in your preferred way. 

Add Issue Source column

With very little modification our starter app is simple, clean and looking good. 

Updated starter app

We need to publish the app to Teams for general use. Click Publish to Teams and update the Name, Icon and fill colors as desired. 

App publishing experience in Teams

Our finished app looks like the image below. 

Our final app rendered in Team and looking good!

Microsoft Lists are great, and I use them every day in my professional life. When requirements exceed what Lists are capable of then migrating to Dataverse for Teams is a smart choice. You don’t have to be a developer to take advantage of what is possible with the out-of-the-box Dataverse for Teams functionality. In future posts we will extend the functionality of our app with Power Automate and Power Apps. 

Thanks for reading! 

NY 

Update: Soon after posting this article, Scott McKenzie let me know that: “Dataflows for Dataverse Teams is now available in preview. If you create a new Dataflow utilizing your existing SharePoint List, you have the ability to create the Entity with matching Fields and transfer the data rather than having to build the Entity and Fields from scratch.” If I were doing straightforward List to Dataverse for Teams migrations I would definitely look into Dataflows.

image-33

nyoung30

Add Power Apps to Microsoft Teams

How to create an app for your team screen

Select your target team and then click Create. 

Enter an app name and Save.

Start this screen With Data

Create a table experience

Source ID column definition

Populated Source ID column.

Owner column using the email column type.

Issue ID column using Autonumber`

Folder Location column using URL column type

Issue Description column using the Text column type

Priority column using the Choice column type

Date Reported column using the date column type

Issue Source column using the Lookup related table column type

Start this screen with data

Power Apps starter app

Editing the form in our starter app

Add Issue Source column

Updated starter app

App publishing experience in Teams

Our final app rendered in Team and looking good!

✇Norm Young

Export Microsoft List data to Excel

I’ve previously written about how to import data from Excel into Microsoft Lists. In this post, we will switch things up and export list data into Excel using Power Automate. In our scenario, we will export a subset of the list data into a date-named spreadsheet that is stored in Microsoft Teams daily.

Excel Preparation

Our solution requires an empty Excel file with columns that match our list schema that has been formatted as a table. This file will serve as a template for the export process and will be named Template.xlsx. Take note of the table name within your template file. 

Excel table shown in Microsoft Teams,

Be sure to take note of the SharePoint site URL associated with the Teams site.
Hint: From the Files tab, click Open in SharePoint and copy the site URL. 

Open in SharePoint from the Files tab in Microsoft Teams

Flow Build

Create a new Flow from our list by clicking Integrate > Power Automate > See your flows. 

Integrate > Power Automate > See your Flows

Click New Flow > Scheduled cloud flow.  

New Flow > Scheduled cloud flow

Supply a Flow name, i.e. “Export List to Excel”, set the recurrence to “Day” and click Create.

Create an Initialize variable action and set: 

  • Name to “varFileName”
  • Type to “String”
  • Value to the following expression: concat('IssueTracker-', utcNow('yyyy-MM-dd'), '.xlsx') 

    Note: This expression generates the file name based on static text (“IssueTracker-“) and the current date. Change the static text as you see fit.
Initialize variable with expression value

Add another Initialize variable action and set: 

  • Name to “varTableName” 
  • Type to “String”
  • Value to the name of the table in the template file, i.e. “Table1”
Initialize variable with static value

Create a SharePoint Copy file action and set: 

  • Current Site Address to our site address noted above 
  • File to Copy, navigate to “/Shared Documents/General/Template.xlsx” 

    Note: “General” is the name of the Teams channel and can be changed to the folder name that corresponds with your desired Teams channel
  • Destination Site Address to our site address
  • Destinate Folder to “/Shared Documents/General”
  • If another file is already there to “Copy with a new name”
SharePoint Copy file action

Add a SharePoint Send an HTTP request to SharePoint action and set: 

  • Site Address to our site address
  • Method to “POST”
  • Uri to “_api/web/lists/GetByTitle(‘Documents’)/items(@{outputs(‘Copy_file_-_Template.xlsx’)?[‘body/ItemId’]})/validateUpdateListItemwhere ItemId comes from the Copy file action
  • Body to: 
{
   "formValues":[
      {
         "FieldName": "FileLeafRef",
         "FieldValue": "@{variables('varFileName')}"
      }
   ]
}
SharePoint Send an HTTP request to SharePoint

Create a new SharePoint Get items action and set: 

  • Site Address to our site address
  • List Name to our target list I.e. “Issue Tracker”
  • Filter Query to Status ne 'Complete' 
     
    Note: The filter query should match your requirements. In my scenario, I am only exporting active issues. 
SharePoint Get items

Create a new Excel Add a row into a table and set: 

  • Location to our site address
  • Document Library to Documents 
  • File to the following expression: concat('/General/', variables('varFileName')) 
    Note: The “General” tab is hardcoded in the expression and can bechange as needed
  • Table to “varTableName”
  • Row to:
    •  Pattern:

      "Excel column name 1": List column name 1, 
      "Excel column name 2": List column name 2 
      }
    • Example:
      {
      "Title": @{items('Apply_to_each')?['Title']}, 
      "Issue description": @{items('Apply_to_each')?['Description']}, 
      "Priority": @{items('Apply_to_each')?['Priority/Value']}, 
      "Status": @{items('Apply_to_each')?['Status/Value']}, 
      "Date reported": @{items('Apply_to_each')?['DateReported']}, 
      "Due Date": @{items('Apply_to_each')?['Duedate']}, 
      "Person or group the issue is assigned to": @{items('Apply_to_each')?['Assignedto/DisplayName']}, 
      "Issue source': @{items('Apply_to_each')?['IssueSource']}, 
      "Issue logged by": @{items('Apply_to_each')?['Issueloggedby/DisplayName']} 

Note: Column names should be updated to match your Excel table schema

Excel Add a row into a table action

My completed Flow looks like the image below. 

My completed Flow

Save and run your Flow. If all goes well, your list rows will be added to a new Excel file with the current date in the filename.

Excel files generate from Microsoft List data.

Manually exporting list data is easy enough but automating the process can take a bit more work than expected. This Flow pattern can be extended to send the Excel file to users or for further integration with other apps and services.

Thanks for reading. 

NY 

image-10

nyoung30

Excel table shown in Microsoft Teams,

Open in SharePoint from the Files tab in Microsoft Teams

Integrate > Power Automate > See your Flows

New Flow > Scheduled cloud flow

Initialize variable with expression value

Initialize variable with static value

SharePoint Copy file action

SharePoint Send an HTTP request to SharePoint

SharePoint Get items

Excel Add a row into a table action

My completed Flow

Excel files generate from Microsoft List data.

❌