Skip to content

Commit b34dc24

Browse files
authored
Merge branch 'main' into ChrisGarty-patch-6
2 parents 4da9e98 + 16af914 commit b34dc24

15 files changed

+195
-23
lines changed

powerapps-docs/developer/data-platform/build-and-package.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Build and package plug-in code
33
description: Learn about building plug-in code into assemblies and packages for later registration and upload to the Microsoft Dataverse service.
4-
ms.date: 02/26/2024
4+
ms.date: 02/29/2024
55
ms.reviewer: pehecke
66
ms.topic: article
77
author: divkamath
@@ -32,15 +32,15 @@ Your assembly may include multiple plug-in classes (or types) and even custom wo
3232

3333
### Signed assemblies are required
3434

35-
Assemblies must be signed before they can be registered with Dataverse only if you are not using the [dependent assemblies](#dependent-assemblies) capability. You can use the Visual Studio **Signing** tab in your project's properties or the [Sn.exe (Strong Name Tool)](/dotnet/framework/tools/sn-exe-strong-name-tool) command to sign the assembly.
35+
Assemblies must be signed before they can be registered with Dataverse only if you aren't using the [dependent assemblies](#dependent-assemblies) capability. You can use the Visual Studio **Signing** tab in your project's properties or the [Sn.exe (Strong Name Tool)](/dotnet/framework/tools/sn-exe-strong-name-tool) command to sign the assembly.
3636

3737
### Dependency on the CoreAssemblies NuGet package
3838

39-
Adding the `Microsoft.CrmSdk.CoreAssemblies` NuGet package to your project includes the required Dataverse assembly references in your project, but it doesn't upload these assemblies along with your plug-in assembly as these assemblies already exist in the server's sandbox run-time where your code will execute.
39+
Adding the `Microsoft.CrmSdk.CoreAssemblies` NuGet package to your project includes the required Dataverse assembly references in your project, but it doesn't upload these assemblies along with your plug-in assembly as these assemblies already exist in the server's sandbox run-time where your code executes.
4040

4141
### Where to go next
4242

43-
If you are interested in learning about or using dependent assemblies, continue reading the next section in this article. If not, proceed to [Register a plug-in](register-plug-in.md).
43+
If you're interested in learning about or using dependent assemblies, continue reading the next section in this article. If not, proceed to [Register a plug-in](register-plug-in.md).
4444

4545
## Dependent assemblies
4646

@@ -68,7 +68,7 @@ When you register individual plug-in assemblies without the dependent assemblies
6868

6969
> [!IMPORTANT]
7070
> If you sign your assemblies, be aware that signed assemblies cannot use resources contained in unsigned assemblies. If you sign your plug-in assemblies or any dependent assembly, all the assemblies that those assemblies depend on must be signed.
71-
>
71+
>
7272
> If any signed assemblies depend on unsigned assemblies, you will get an error similar to the following: Could not load file or assembly \<AssemblyName>, Version=\<Version>, Culture=neutral, PublicKeyToken=null or one of its dependencies. A strongly-named assembly is required.
7373
7474
### Dependent assemblies limitations
@@ -77,15 +77,47 @@ The following limitations apply when using plug-in dependent assemblies.
7777

7878
- [Workflow extensions](workflow/workflow-extensions.md), also known as *custom workflow activities* aren't supported when using the dependent assemblies capability.
7979
- On-premises environments aren't supported.
80-
- Un-managed code isn't supported. You can't include references to unmanaged resources.
80+
- Un-managed code isn't supported. You can't include references to un-managed resources.
8181

8282
## Creating a plug-in package
8383

84-
Your plug-in assembly plus any required dependent assemblies can be placed together in a NuGet package and then registered and uploaded to the Dataverse server. You do not need to create a package if your plug-in project does not require any dependent assemblies at run-time, other than what ships in the Microsoft.CrmSdk.CoreAssemblies NuGet package.
84+
Your plug-in assembly plus any required dependent assemblies can be placed together in a NuGet package and then registered and uploaded to the Dataverse server. You don't need to create a package if your plug-in project doesn't require any dependent assemblies at run-time, other than what ships in the Microsoft.CrmSdk.CoreAssemblies NuGet package.
8585

8686
<!-- Add correct links when available -->
8787
Instructions for creating a plug-in package using an interactive tool can be found in these separate how-to's: [Create and register a plug-in package using PAC CLI](/power-platform/developer/howto/cli-create-package), [Create and register a plug-in package using Visual Studio](/power-platform/developer/howto/vs-create-package).
8888

89+
## All projects must be in the SDK style
90+
91+
A plug-in package must only contain custom assemblies that are built from a project file in a specific format known as the *SDK style*. Failure to follow this rule results in an error ("file can not be found") when attempting to register the package using the Plug-in Registration tool.
92+
93+
> [!IMPORTANT]
94+
> All MSBuild projects, where the resulting compiled assembly is to be added to a plug-in package, must be in the "SDK style" format.
95+
96+
An SDK style project is one where the contents of the project's .csproj file contains the following line of code: `<Project Sdk="Microsoft.NET.Sdk">`.
97+
98+
When you create a plug-in project using one of our tools, for example the Power Platform CLI `pac plugin init` command, the plug-in project file is in the correct format. Here's an example of such a project file.
99+
100+
```makefile
101+
<Project Sdk="Microsoft.NET.Sdk">
102+
103+
<PropertyGroup>
104+
<TargetFramework>net462</TargetFramework>
105+
<PowerAppsTargetsPath>$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps</PowerAppsTargetsPath>
106+
<AssemblyVersion>1.0.0.0</AssemblyVersion>
107+
<FileVersion>1.0.0.0</FileVersion>
108+
<ProjectTypeGuids>{4C25E9B5-9FA6-436c-8E19-B395D2A65FAF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
109+
</PropertyGroup>
110+
...
111+
</Project>
112+
```
113+
114+
If you're adding another project to the Visual Studio solution, say a class library project, you can create an SDK style project by following these steps.
115+
116+
1. In Visual Studio, add the new project to your solution using a .NET or .NET Standard template. Do not target .NET Framework.
117+
1. Edit the project file by right-clicking on the project name in Solution Explorer and select **Edit project file**, or simply open the project's .csproj file in a separate editor.
118+
1. You should see the line `<Project Sdk="Microsoft.NET.Sdk">` in the project file. Change the TargetFramework property to be `<TargetFramework>net462</TargetFramework>` and save the file.
119+
1. Verify your solution builds, and you're done.
120+
89121
### Don't depend on System.Text.Json
90122

91123
Because the Microsoft.CrmSdk.CoreAssemblies NuGet package has a [dependency](https://www.nuget.org/packages/Microsoft.CrmSdk.CoreAssemblies#dependencies-body-tab) on System.Text.Json, you're able to refer to [System.Text.Json](xref:System.Text.Json) types at design time. However, the System.Text.Json.dll file in the sandbox run-time can't be guaranteed to be the same version that you reference in your project. If you need to use `System.Text.Json`, you should use the dependent assembly feature and explicitly include it in your NuGet package.

powerapps-docs/maker/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@
460460
href: ./canvas-apps/use-line-pie-bar-chart.md
461461
- name: Add multimedia
462462
href: ./canvas-apps/add-images-pictures-audio-video.md
463+
- name: Use Copilot answer control (preview)
464+
href: ./canvas-apps/copilot-answer-control-overview.md
463465
- name: "Add mixed reality controls"
464466
items:
465467
- name: Mixed reality controls
@@ -540,6 +542,8 @@
540542
href: ./canvas-apps/controls/modern-controls/modern-controls-badge.md
541543
- name: Checkbox (preview)
542544
href: ./canvas-apps/controls/modern-controls/modern-control-checkbox.md
545+
- name: Copilot answer (preview)
546+
href: ./canvas-apps/controls/modern-controls/modern-control-copilot-answer.md
543547
- name: Date picker (preview)
544548
href: ./canvas-apps/controls/modern-controls/modern-controls-date-picker.md
545549
- name: Dropdown (preview)

powerapps-docs/maker/canvas-apps/connections/connection-azure-sqldatabase.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,41 @@ You can directly call SQL Server stored procedures from Power Fx by turning on t
4747

4848
1. Go to **Settings** > **Upcoming features** > **Preview**.
4949
1. Search for _stored procedures_.
50-
1. Turn on the preview switch as shown.
50+
1. Turn on the preview switch as shown. (You will need to save and reopen the app.)
5151

5252
:::image type="content" source="media/connection-azure-sqldatabase/previewflag-call-sp-direct.png" alt-text="Screenshot that shows the SQL Server stored procedures toggle set to On.":::
5353

54-
When you add a SQL Server connection to your app, you can now add tables and views or stored procedures.
54+
When you add a SQL Server connection to your app, you can now add tables and views or stored procedures. This feature also works with secure implicit connections.
5555

5656
:::image type="content" source="media/connection-azure-sqldatabase/tables-views-stored-proc-selector.png" alt-text="Screenshot that shows lists of tables, views, and stored procedures available to be added to your app.":::
5757

5858
If you don't immediately see your stored procedure, it's faster to search for it.
5959

6060
Once you select a stored procedure, a child node appears and you can designate the stored procedure as **Safe to use for galleries and tables**. If you check this option, you can assign your stored procedure as an **Items** property for galleries for tables to use in your app.
6161

62-
Enable this option only if:
62+
Enable this option **only if**:
6363

64-
1. There are no side effects to calling this procedure on demand, multiple times, whenever Power Apps refreshes the control. When used with an **Items** property of a gallery or table, Power Apps calls the stored procedure whenever the system determines a refresh is needed. You can't control when the stored procedure is called.
65-
2. The stored procedure returns less than the delegable limit (500/2000) of records. When a table or view is assigned to an **Items** property, Power Apps can control the paging and bring in 100 records at a time, when it needs it. Stored procedures are different and might be pageable through an argument to the stored procedure. But Power Apps can't bring in pages automatically like it can for tables and views. The author must configure pageability.
64+
1. There are **no side effects** to calling this procedure on demand, multiple times, whenever Power Apps refreshes the control. When used with an **Items** property of a gallery or table, Power Apps calls the stored procedure whenever the system determines a refresh is needed. You can't control when the stored procedure is called.
65+
2. The amount of data you return in the stored procedure is **modest**. Action calls, such as stored procedures, do not have a limit on the number of rows retrieved. They are not automatically paged in 100 record increments like tabular data sources (tables or views.) So, if the stored procedure returns a lot of data (many thousands of records) then your app may slow down or crash. For performance reasons you should bring in less than 2000 records.
6666

6767
### Example
6868

6969
When you add a stored procedure, you might see more than one data source in your project.
7070

7171
:::image type="content" source="media/connection-azure-sqldatabase/sqlserver-datasources.png" alt-text="Screenshot that shows SQL data sources.":::
7272

73-
Prefix the stored procedure name with the name of connector associated with it. For example, _DataCardValue3_1.Text_ is from the _DataCard_ connector.
73+
To use a stored procedure in Power Apps, first prefix the stored procedure name with the name of connector associated with it and the name the stored procedure. 'Paruntimedb.dbonewlibrarybook' in the example illustrates this pattern. Note also that when Power Apps brings the stored procedure in, it concatenates the full name. So, 'dbo.newlibrarybook' becomes 'dbonewlibrarybook'.
7474

75-
Label the values, for example using a number, as necessary since you're reading from a text value in Power Apps.
75+
Remember to convert values appropriately as you pass them into your stored procedure as necessary since you're reading from a text value in Power Apps. For example, if you are updating an integer in SQL you must convert the text in the field using 'Value()'.
7676

7777
![Calling stored procedures directly.](media/connection-azure-sqldatabase/calling-sp-directly.png "Calling stored procedures directly.")
7878

7979
> [!TIP]
80-
> To use a stored procedure in an **Item** property for a gallery or table, use the stored procedure name where you'd use the table name.
80+
> To use a stored procedure in an **Item** property for a gallery or table, use the stored procedure name where you'd use the table name. Views do not have primary keys so you will need to supply a key value for record specific operations. You can access the stored procedure after you declare it safe for the UI. Reference the data source name and the the name of the stored procedure followed by 'ResultSets'. You can access multiple results by indexing through list of tables returned.
81+
>
82+
```powerapps-dot
83+
Paruntimedb.dbospshowalllibrarybooks().ResultSets.Table1
84+
```
8185

8286
## Known issues
8387

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Copilot answer modern control in Power Apps
3+
description: Learn about the details, properties, and examples of the Copilot answer modern control in Power Apps.
4+
author: yogeshgupta698
5+
6+
ms.topic: reference
7+
ms.component: canvas
8+
ms.date: 2/14/2024
9+
ms.subservice: canvas-maker
10+
ms.author: yogupt
11+
ms.reviewer: mkaur
12+
search.audienceType:
13+
- maker
14+
contributors:
15+
- mduelae
16+
- yogeshgupta698
17+
18+
---
19+
# Copilot answer modern control in Power Apps (preview)
20+
21+
[This article is pre-release document and is subject to change.]
22+
23+
A control that makers can use to add predefined questions that end users can use to get generated answers.
24+
25+
## Description
26+
27+
Makers can use the Copilot answer control to set predefined questions that end users can use to get generative answers with a single click. The control is optimized for mobile users and is powered by Microsoft Copilot.
28+
29+
## Key properties
30+
31+
**Data source (Items)** – The Copilot answer control only supports Dataverse as the data source. The answer to the question comes from the Dataverse table that you select.
32+
33+
**Views** – A user can select any of the views that are available in the data source.
34+
35+
**Fields** - Default list of fields available for the table. Users can select **Edit** to see the list of fields. They can also add or modify the fields based on their requirements.
36+
37+
**Title** – A label that is displayed at the top of the Copilot answer control.
38+
39+
**Question for Copilot** – This is the question a maker asks the Copilot answer control. The question is used as the prompt to generate a response that is displayed by the answer control that's based on the selected **Data source** property.
40+
41+
42+
## Additional properties
43+
44+
**Show answer** – Should the Copilot answer control answer a question when the user clicks on the ‘Arrow’ icon (After sending) or as soon as the control loads when the question is defined in the properties window (Immediate).
45+
46+
**DisplayMode** – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).
47+
48+
**Position** - Whether a control appears or is hidden.
49+
50+
**[X](../properties-size-___location.md)** – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).
51+
52+
**[Y](../properties-size-___location.md)** – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).
53+
54+
**[Size](../properties-text.md)** – The size of the control on the canvas

powerapps-docs/maker/canvas-apps/controls/modern-controls/modern-controls-reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Configure the behavior of a modern control by setting one of its properties. Eac
3131

3232
**[Checkbox](modern-control-checkbox.md)** - Select or clear an option to specify **true** or **false**.
3333

34+
**[Copilot answer (preview)](modern-control-copilot-answer.md)** - A control that makers can use to add predefined questions that end users can use to get generated answers.
35+
3436
**[Date picker](modern-controls-date-picker.md)** - A control that the user can select to specify a date.
3537

3638
**[Dropdown](modern-control-dropdown.md)** – Select a value from the list of items.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Overivew of Copilot answer control for canvas apps
3+
description: Use the Copilot answer control for canvas app.
4+
author: mduelae
5+
ms.topic: conceptual
6+
ms.custom: canvas
7+
ms.collection:
8+
- bap-ai-copilot
9+
- get started
10+
ms.reviewer: mkaur
11+
ms.date: 2/13/2024
12+
ms.subservice: canvas-maker
13+
ms.author: arijitba
14+
search.audienceType:
15+
- maker
16+
contributors:
17+
- mduelae
18+
---
19+
20+
# Use Copilot answer control for canvas apps (preview)
21+
22+
[This article is prerelease documentation and is subject to change.]
23+
24+
Makers can use the Copilot answer control to set predefined questions that end users can use to get AI-generated information with a single click. The control is powered by Microsoft Copilot and is designed for mobile users to provide them with immediate answers to frequently asked questions.
25+
26+
:::image type="content" source="media/answer-control/answer-control-shown-on-mobile.png" alt-text="Answers shown on mobile":::
27+
28+
## Enable Copilot answer control for your environment
29+
30+
To use the Copilot answer control in a canvas app, an admin must first turn on the feature, **Allow canvas editors to insert the Copilot answer component, which allows users to receive an AI-powered answer to a predefined data query** in their environment.
31+
32+
This setting can be found in the [Power Platform admin center](https://admin.powerplatform.microsoft.com) by going to **Environments** > [select an environment] > **Settings** > **Product** > **Features**. For more information, see [Manage feature settings](/power-platform/admin/settings-features#copilot-preview).
33+
34+
:::image type="content" source="media/answer-control/answer-control-enable-by-admin.jpg" alt-text="Turn on Copilot answer control on Power Platform admin center":::
35+
36+
## Add Copilot answer control
37+
38+
With your [canvas app open for editing](edit-app.md) in Power Apps Studio:
39+
40+
1. On the command bar, select **Insert** and then select one of the following options:
41+
42+
- **Modern** > **Copilot answer (preview)**
43+
- **Classic** > **Copilot answer (preview)**
44+
45+
:::image type="content" source="media/answer-control/answer-control-insert.png" alt-text="Insert answer control":::
46+
47+
1. When the **Copilot answer (preview)** control is added to the canvas app, select a data source from the pane. Copilot only supports Dataverse tables.
48+
49+
:::image type="content" source="media/answer-control/answer-control-select-data-type.png" alt-text="Select data source":::
50+
51+
1. On the control properties pane, select the **Properties** tab.
52+
53+
1. In the properties, enter the **Title**, **Questions for Copilot**, and **Show answer** for the question. You can also edit other control properties as needed.
54+
55+
:::image type="content" source="media/answer-control/answer-control-properties.png" alt-text="Answer control properties":::
56+
57+
1. When you're done, [save and publish](save-publish-app.md) your app.
58+
59+
## Use Copilot answer control
60+
61+
End users can regenerate responses and provide feedback on the quality of responses.
62+
63+
Follow these steps to see answers generated by the Copilot answer control:
64+
65+
1. Open a canvas app on Power Apps mobile and navigate to the Copilot answer control in your app.
66+
1. On the Copilot answer control select, **Send**.
67+
68+
:::image type="content" source="media/answer-control/answer-control-send.png" alt-text="Use Copilot answer control on mobile":::
69+
70+

0 commit comments

Comments
 (0)