In the workshop app, open Snippet - Demo 0 and add a Button or another simple control.
Expect: The new control appears with its default properties.
ESPC26 · Brick by Brick · Lab 01
Turn a working Power Apps gallery into a portable definition that another maker can understand, paste, and use.
The goal: learn why copied YAML can look broken even when the controls copied correctly, then remove its data, image, and media dependencies one at a time until the gallery works in a clean app.
Get ready
Concept
The workshop app contains the completed examples, Dataverse data, imported media, and an empty screen for testing inside the same app. Keep a second, clean canvas app open in another browser tab. The clean app is the real portability test because it does not already contain the workshop app's dependencies.
| Screen | How you will use it |
|---|---|
Snippet - Demo 0 | Build and inspect the simple portable control. |
Lego Sets - Demo 1 - DV | See the original gallery and its live Dataverse and media dependencies. |
Lego Sets - Demo 2 - DV Img | Review the completed Base64-image checkpoint. |
Lego Sets - Demo 2 - DV Img - Export Ready | Make the learner changes; its gallery starts with an intentionally empty Items property. |
Lego Sets - Demo 3 - SVG | Compare your final result with the completed answer key. |
Data Export | Generate and automatically copy the standard or Base64 record table. |
Blank Screen | Test an in-app paste where the existing app dependencies are still available. |
The easy success
Concept
Power Apps can expose the definition of a control as YAML. That definition includes the control's type, properties, formulas, and behavior. A small control with no outside dependencies is the clearest place to see the idea work.
In the workshop app, open Snippet - Demo 0 and add a Button or another simple control.
Expect: The new control appears with its default properties.
Right-click the control and choose the command that displays its code.
Look for the properties you changed. You do not need to understand every line. The important idea is that the control you created in the designer has a readable definition behind it.
Expect: The YAML changes reflect the text, visual property, and behavior you configured.
Copy the control's YAML and paste it into the blank app.
Test the button after it appears. Its text, styling, and Notify() behavior should travel with the definition because nothing depends on data or media that exists only in the first app.
Expect: The control appears and behaves like the original.
Make the records portable
Concept
The first portability improvement is to replace the direct Dataverse reference with a table of records embedded in the gallery's definition. The workshop app's Data Export screen builds that Power Fx table for you.
Open Data Export and select Concat DV.
Concat DV is the standard export without embedded Base64 image data. It places the generated table in the output area and automatically copies the same value to your clipboard. Review the formula before running it and notice how Concat() assembles the source rows into text Power Apps can read again as a table of records.
Expect: The screen displays and copies a Power Fx table containing the sample records and image URLs.
Open Lego Sets - Demo 2 - DV Img - Export Ready and paste the copied table into the gallery's empty Items property.
This screen intentionally begins with formula errors because Items is empty. Select the gallery, paste the Concat DV output into Items, and confirm that six records appear. The temporary errors should resolve when the record fields become available.
Expect: The gallery displays records without using the Dataverse table directly.
On Lego Sets - Demo 2 - DV Img - Export Ready, copy the updated gallery YAML and paste it into the clean app.
This is intentional progress: the Dataverse dependency is gone, while the imported SVG media dependency is now isolated and easier to see.
Expect: The gallery shows its text and image-URL pictures, but the imported SVG frame is still missing.
Encode the image
Concept
An internet URL remains reachable from another app. An image supplied by a Dataverse image column may work inside the source app but does not become an independent asset merely because its control was copied. For a small sample, the image can be represented as Base64 data and carried with the record.
On Lego Sets - Demo 2 - DV Img - Export Ready, change the picture control from the internet Image URL field to LegoSetImage.
Expect: The image works in its original app.
Copy and paste the gallery into the clean app again.
Expect: The Dataverse image fails because the copied definition does not contain the source image bytes.
Return to Data Export, clear the prior output, and select Concat DV + B64.
Concat DV + B64 displays the generated table and automatically copies it to your clipboard. Compare the two exports. The larger definition is less elegant, but it is self-contained and useful as a workshop sample, fallback, or temporary portable asset.
Expect: The exported table is substantially larger because each image is represented as data rather than a reference.
Put the Base64 table into the gallery on Lego Sets - Demo 2 - DV Img - Export Ready, then copy that gallery's YAML to the clean app.
Expect: The records and LEGO pictures render in the clean app. Only the SVG frame dependency remains.
Finish the portable gallery
Concept
The final missing piece is the LEGO frame. Instead of referring to an SVG stored in the source app's media library, the Image control can use a Power Apps-friendly SVG expression. That makes the frame part of the definition itself.
On Lego Sets - Demo 2 - DV Img - Export Ready, replace the frame Image property's imported-media reference with the prepared inline SVG expression.
Expect: The frame looks the same, but no longer depends on the original app's media library.
Copy the completed gallery YAML and paste it into the clean app one final time.
Expect: Text, LEGO pictures, formulas, layout, and the SVG frame all work without adding the original Dataverse table or media file.
Open Lego Sets - Demo 3 - SVG and compare its Items and Image properties with your export-ready screen.
Expect: The important dependencies are packaged in the same way, even if control names or formatting differ.
From copy to library
Concept
A useful organizational library can help makers avoid rebuilding common patterns and help newer builders learn from proven examples. The best entries explain what they contain, what they depend on, where they are configurable, and how to verify that they worked.
Review the completed gallery as if you were receiving it from another maker.
Write down short answers:
Expect: You can describe what travels with it, what can be configured, and how to know it works.
Optional · Powerful Animations
Concept
The free Powerful Animations extension for VS Code can prepare SVG markup for a Power Apps Image property, preview the result, and create dynamic Power Fx variables. This bonus reproduces the prepared frame workflow rather than requiring it for the core lab.
Download the lab's LEGO frame SVG and open it in Visual Studio Code.
Expect: The SVG source is visible as editable XML.
Use Powerful Animations to run Prepare SVG for Power Apps.
Preview the output before using it. Then paste the generated expression into an Image control in your clean app.
Expect: The extension produces a Power Apps Image formula and makes it available to paste.
Select a hardcoded color in the SVG and create a dynamic SVG variable using the With() option.
Expect: The generated formula remains self-contained, and changing the default value changes the rendered frame.
Optional · Just for fun
Concept
A very short MP3 can be represented as a Base64 data URI and assigned to an Audio control. This is a memorable experiment, not a recommendation to embed large production audio files in formulas.
Add an Audio control and assign the lab's prepared Base64 MP3 data URI to its Media property.
Expect: The short sound plays without importing the original MP3 into the app's media library.
Bridge to components
Concept
The same decisions you made here carry into Power Apps components and component libraries:
YAML helps you move and inspect a definition. Components give reusable behavior a deliberate interface. Component libraries add a maintained distribution and update path.