Skip to content

Commit 9670e69

Browse files
authored
Merge pull request #10909 from MicrosoftDocs/marcelbf-codeview-ga
Marcelbf codeview ga
2 parents f3a66f6 + c108869 commit 9670e69

File tree

5 files changed

+38
-72
lines changed

5 files changed

+38
-72
lines changed

powerapps-docs/maker/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,9 +1258,9 @@
12581258
items:
12591259
- name: Working with Source Code
12601260
items:
1261-
- name: Code View (preview)
1261+
- name: Code View
12621262
href: ./canvas-apps/code-view.md
1263-
- name: View source code files for canvas apps (preview)
1263+
- name: Source code files for canvas apps
12641264
href: ./canvas-apps/power-apps-yaml.md
12651265
- name: Use Git version control to edit canvas apps (experimental)
12661266
href: ./canvas-apps/git-version-control.md

powerapps-docs/maker/canvas-apps/code-view.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use code view for canvas app controls (preview)
33
description: Learn how to use the code view in Microsoft Power Apps Studio to understand your canvas app's functionality.
44
author: marcelbf
55
ms.author: marcelbf
6-
ms.date: 11/13/2024
6+
ms.date: 3/18/2025
77
ms.topic: conceptual
88
ms.reviewer: mkaur
99
ms.subservice: canvas-maker
@@ -17,9 +17,7 @@ ms.custom:
1717
- ai-gen-diyeditor
1818
---
1919

20-
# Use code view for canvas app controls (preview)
21-
22-
[!INCLUDE [preview-banner](~/../shared-content/shared/preview-includes/preview-banner.md)]
20+
# Use code view for canvas app controls
2321

2422
Use the code view feature to look at the underlying code for each control on your app's screens. The code uses an improved format that's a subset of YAML.
2523

@@ -29,26 +27,17 @@ With code view you can:
2927
- Copy the code for a control and share it outside of Power Apps Studio.
3028
- Paste the code for a control and create a new control based on it.
3129

32-
> [!IMPORTANT]
33-
>
34-
> - This is a preview feature.
35-
> - Preview features aren't meant for production use and might have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
36-
37-
> [!NOTE]
38-
> Since this is a preview feature and the format is subject to change. We don't guarantee compatibility with the final version.
39-
> The current code format seen in the code view isn't suitable for source control during the preview period.
40-
4130
## View, copy, and paste code
4231

4332
Code view shows the code for the selected control and all its child controls.
4433

45-
Code view lets you copy and paste code to any screen in your app, or outside of Power Apps, to duplicate the control. This duplication feature is helpful when controls are highly customized and you want to share or duplicate it.
34+
Code view lets you copy and paste code to any screen in your app or outside of Power Apps to duplicate the control. This feature is helpful when controls are highly customized and you want to share or duplicate them.
4635

4736
### View code
4837

4938
1. Open your app for [editing](edit-app.md) in Power Apps Studio.
5039

51-
1. Right-click the control in the tree view or on the screen, and then select **View code (preview)**.
40+
1. Right-click the control in the tree view or on the screen, and then select **View code**.
5241

5342
:::image type="content" source="media/code-view/view-code.png" alt-text="Screenshot of the tree view in Power Apps Studio, with the View code option on a control's context menu highlighted.":::
5443

@@ -57,23 +46,24 @@ Code view lets you copy and paste code to any screen in your app, or outside of
5746
5847
### Copy and paste code
5948

60-
1. When viewing your code in the code view popup, select **Copy code**.
61-
1. Share it or paste it to create a duplicate of the selected control:
49+
1. To copy the code of a selected control:
50+
- Use the menu to copy.
51+
- Use the shortcut <kbd>Ctrl</kbd>+<kbd>C</kbd>.
52+
- When viewing your code in the code view popup, select **Copy code**.
53+
1. To add a new control from the code:
6254

63-
- To share it, paste the copied code in any window.
64-
- To add a new control from the copied code, right-click the screen where you want to add the new control, and then select, **Paste code (preview)**.
55+
- Use the menu to paste.
56+
- Use the shortcut <kbd>Ctrl</kbd>+<kbd>V</kbd>.
6557

6658
:::image type="content" source="media/code-view/paste-code.png" alt-text="Screenshot of the tree view in Power Apps Studio, with the Paste code option highlighted on a control's context menu.":::
6759

6860
> [!IMPORTANT]
69-
> You must use the YAML format that Power Apps Studio generates. The code is validated before the new control is created.
61+
> Use the YAML format that Power Apps Studio generates. The code is validated before the new control is created.
7062
7163
## Known limitations
7264

7365
- You can't copy and paste or view the code for the **App Object**.
7466
- You can't edit the code in the code view.
75-
- You can only copy controls that are on a screen. You can't copy a screen.
76-
- When you paste code, the new control is positioned at coordinates X=40, Y=40. In the future, the X and Y properties that you set are respected.
7767

7868
## Related information
7969

Loading
Loading

powerapps-docs/maker/canvas-apps/power-apps-yaml.md

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: View source code files for canvas apps (pa.yaml)
2+
title: Source code files for canvas apps (pa.yaml)
33
description: Learn about how to view source code files for canvas apps.
44
author: marcelbf
55
ms.author: marcelbf
6-
ms.date: 11/1/2024
6+
ms.date: 3/18/2025
77
ms.topic: conceptual
88
ms.reviewer:
99
ms.subservice: canvas-maker
@@ -15,24 +15,14 @@ ms.custom:
1515
- canvas
1616
---
1717

18-
# View source code files for canvas apps (preview)
18+
# View source code files for canvas apps
1919

20-
[!INCLUDE [preview-banner](~/../shared-content/shared/preview-includes/preview-banner.md)]
20+
Use the source code for a canvas app to review changes made by makers in Power Apps Studio. The generated canvas app YAML code is read-only and can't be modified. Any changes to the file are ignored and might be lost.
2121

22-
You can use the source code for a canvas app to review changes made my makers in Power Apps Studio. The generated canvas app YAML code is read-only and shouldn't be modified. Any change in the file will be ignored and can be lost.
22+
> - The YAML schema is in active development, and the content might be incomplete.
23+
> - The current static schema for ***.pa.yaml** files is available [here](https://raw.githubusercontent.com/microsoft/PowerApps-Tooling/refs/heads/master/schemas/pa-yaml/v3.0/pa.schema.yaml).
2324
24-
Currently, we don't recommended that you modify **pa.yaml** files or create canvas apps using other text editors. However, more scenarios will be supported in the future.
25-
26-
> [!NOTE]
27-
> - The YAML schema is in active development, the content may be incomplete.
28-
> - The current proposed static schema for ***.pa.yaml** files can be found, [here](https://raw.githubusercontent.com/microsoft/PowerApps-Tooling/refs/heads/master/schemas/pa-yaml/v3.0/pa.schema.yaml).
29-
30-
31-
We use Power Fx and YAML as the languages for Power Apps source code. YAML is appreciated for its human-readable format and benefits from a wide array of existing editors, tools, and libraries for its manipulation.
32-
33-
## Prerequisite
34-
35-
To use this feature, you must create an [Early release cycle environment](/power-platform/admin/early-release).
25+
Power Fx and YAML are the languages used for Power Apps source code. YAML is valued for its human-readable format and benefits from a wide array of editors, tools, and libraries for manipulation.
3626

3727
## Access source code files
3828

@@ -41,7 +31,7 @@ You have access to the source code files if you're using the [Dataverse Git Inte
4131
The Power Apps Studio creates the source code for canvas apps, which is stored as *.pa.yaml files within the **.msapp** file. The **.msapp** file is a binary file that contains a collection of files, including the source code.
4232

4333
> [!TIP]
44-
> To effectively use ALM, it's recommended to use solutions. [Canvas apps package](export-import-app-package.md) doesn't support ALM and should only be used for basic import and export capabilities when Dataverse isn't available.
34+
> To effectively use application lifecycle management (ALM), it's recommended to use solutions. [Canvas apps package](export-import-app-package.md) doesn't support ALM and should only be used for basic import and export capabilities when Dataverse isn't available.
4535
4636
You can also get the source code files either from the **.msapp** file or by using [Power Platform CLI](/power-platform/developer/cli/introduction).
4737

@@ -85,67 +75,53 @@ In the **\src** folder, find the following files and folders:
8575

8676
Only ***.pa.yaml** files within the **\src** folder can be used as source code. Any other file shouldn't be used as source code.
8777

88-
89-
## Power Fx YAML
90-
91-
Microsoft Power Fx utilizes a grammar for expressions that is based on Excel and well-established. However, when using Power Apps and other hosts that rely on UI for formula binding, there's no standardized method for editing formula bindings as text.
92-
93-
We choose [YAML](https://yaml.org/spec/1.2/spec.html) as the industry standard language for formula binding. YAML has a wide array of editors, tools, and libraries available for working with it.
94-
95-
> [!NOTE]
96-
> Currently, we only support a limited subset of YAML. Only the constructs outlined in this article are supported. More information: [Power Fx YAML formula grammar](/power-platform/power-fx/yaml-formula-grammar).
97-
9878
## Power Apps YAML schema versions
9979

100-
Currently there are three schema versions of Power Apps Source Code:
80+
Currently, there are three schema versions of Power Apps source code:
10181

102-
|Format Name|File Extension|Description|
82+
|Format name|File extension|Description|
10383
|-----------|-----------|-------|
104-
| [Experimental](power-apps-yaml.md#experimental-format-fxyaml) | *.fx.yaml| Version used by the experimental [Power Apps Git version control](git-version-control.md) and [pac canvas unpack](/power-platform/developer/cli/reference/canvas#pac-canvas-unpack) - no longer in development.|
105-
| [Early Preview](power-apps-yaml.md#early-preview) | - | The version used by code view, copy code, and paste code. There's no version information in this schema, therefore it isn't suitable for version control. When [code view](code-view.md) is generally available (GA), it switches to the source code preview format.|
106-
| [Source Code](power-apps-yaml.md#source-code-payaml) | *.pa.yaml files | Includes enhancements and version details for source control and it is in active development. |
107-
108-
>[!NOTE]
109-
> You can't copy YAML code from a pa.yaml file and paste it as code in Power Apps Studio. However, in the future, code view will utilize the source code format for this purpose.
84+
| [Experimental](power-apps-yaml.md#experimental-format-fxyaml) | *.fx.yaml| Version used by the experimental [Power Apps Git version control](git-version-control.md) and [pac canvas unpack](/power-platform/developer/cli/reference/canvas#pac-canvas-unpack)—no longer in development.|
85+
| [Early preview](power-apps-yaml.md#early-preview) | - | The version used by code view, copy code, and paste code. There's no version information in this schema, so it isn't suitable for version control. When [code view](code-view.md) is generally available (GA), it switches to the source code preview format.|
86+
| [Source code](power-apps-yaml.md#source-code-payaml) | *.pa.yaml files | Includes enhancements and version details for source control and is in active development. |
11087

11188
## Experimental format (*.fx.yaml)
11289

113-
This schema represents an experimental format employed by the Power Platform CLI to process and convert canvas apps into a source code format. However, this format is no longer being actively developed.
90+
This schema describes an experimental format used by the Power Platform CLI to process and convert canvas apps into a source code format. This format isn't actively developed anymore.
11491

115-
You can't directly convert ***.fx.yaml** files to the new formats. To convert older apps, you need to package the canvas app as a **.msapp** file and import it into Power Apps Studio.
92+
You can't directly convert ***.fx.yaml** files to the new formats. To convert older apps, package the canvas app as a **.msapp** file and import it into Power Apps Studio.
11693

117-
## Early Preview
94+
## Preview
11895

119-
This version is used by [Code view](code-view.md). Is designed to create apps within Power Apps Studio, letting you easily copy and paste controls. In this version, the source code is used in Power Apps Studio instead of being converted (like the experimental format).
96+
This version is used by [Code view](code-view.md) during the [preview](working-with-experimental-preview.md#preview) period. It is designed to create canvas apps in Power Apps Studio, letting you easily copy and paste controls. In this version, the source code is used in Power Apps Studio instead of being converted, like the experimental format.
12097

121-
The Early Preview format is a preview feature and is temporary. In the future, both code view, copy code, and paste code are going to use the same source code version.
98+
The format during the preview was temporary and is no longer in use. You can paste code from the preview format.
12299

123100
Here are the changes made from the experimental format:
124101

125-
1. **ZIndex Property Removal**: The ZIndex property is removed. Instead, a screen is now represented as an array of controls. The order of controls now determines their stacking order. Normal controls are ordered in ascending order, while responsive controls are ordered in descending order.
126-
1. **JSON Object Representation Replacement**: We no longer use the "As" syntax to define the control type. Instead, the left side of the control's name identifier remains unique. Only properties that differ from the default values are serialized. Two new properties are added to define the control type and default values:
102+
1. **ZIndex property removal**: The ZIndex property is removed. Instead, a screen is represented as an array of controls. The order of controls determines their stacking order. Normal controls are ordered in ascending order, while responsive controls are ordered in descending order.
103+
1. **JSON object representation replacement**: The "As" syntax is no longer used to define the control type. Instead, the left side of the control's name identifier remains unique. Only properties that differ from the default values are serialized. Two new properties define the control type and default values:
127104

128105
- **Control**: Represents the control type in YAML.
129-
- **Variant**: Identifies a variant of a control type, which might alter default property values, add or remove properties, or modify the behavior/layout of the control.
106+
- **Variant**: Identifies a variant of a control type, which might alter default property values, add or remove properties, or modify the behavior or layout of the control.
130107

131108
These properties are used for instantiating controls and don't accept Power Fx expressions.
132-
133109
## Source code (*.pa.yaml)
134110

135111
> [!IMPORTANT]
136112
>
137-
> - The YAML source code for canvas apps is currently in preview and actively being developed. The content may be incomplete and subject to change.
113+
> - The YAML source code for canvas apps is actively being developed. The content may be incomplete and subject to change.
138114
> - The **.pa.yaml** files are read-only and should only be used to review changes made in Power Apps Studio. These files are not used when an app is loading.
139115
> - External editing, merging, and conflict resolution isn't supported.
140116
141-
This schema is designed for source control purposes and allows the use of a single YAML file. It's an updated format compared to the previous code view.
117+
This schema is designed for source control purposes and allows the use of a single YAML file.
142118

143119
Updates from the previous format include:
144120

145121
1. Grouping of Top-Level Node Elements:
146122
- The top-level keywords "App" and "Screens" are examples of how elements are now grouped in a top-level node.
147123
2. Control Version Specification:
148-
- You can now specify the version of a control using the Control Keyword followed by the **@** operator. If no version is specified, the most current version of the control is used.
124+
- You can now specify the version of a control using the Control Keyword followed by the **@** operator. If no version is specified, the most current version of the control is used. The version is used to deserialize the properties of the source code. Runtime version of the control is defined by the authoring version.
149125
3. Simplified Variant Names:
150126
- Not all controls require a variant.
151127
4. Consistent ZIndex for All Controls:

0 commit comments

Comments
 (0)