0:00

ESPC26 · Brick by Brick · Lab 01

Build YAML worth sharing.

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.

Back to all labs

Get ready

Before You Begin

Concept

You will use two apps

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.

Workshop screen map

ScreenHow you will use it
Snippet - Demo 0Build and inspect the simple portable control.
Lego Sets - Demo 1 - DVSee the original gallery and its live Dataverse and media dependencies.
Lego Sets - Demo 2 - DV ImgReview the completed Base64-image checkpoint.
Lego Sets - Demo 2 - DV Img - Export ReadyMake the learner changes; its gallery starts with an intentionally empty Items property.
Lego Sets - Demo 3 - SVGCompare your final result with the completed answer key.
Data ExportGenerate and automatically copy the standard or Base64 record table.
Blank ScreenTest an in-app paste where the existing app dependencies are still available.

The easy success

1 · Start With A Portable Control

Concept

A control is stored as readable YAML

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.

Create, inspect, and reuse a simple control

1

Add a simple control

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.

2

Inspect the control's YAML

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.

3

Paste the control into the clean app

Payoff

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.

The useful failure

2 · Discover The Hidden Dependencies

Concept

Copyable does not automatically mean portable

The LEGO gallery is more realistic than the button. Its controls and formulas can copy correctly while its Dataverse table and imported SVG remain behind. The red errors are not proof that the YAML is bad; they reveal dependencies that have not been packaged with it.

Compare an in-app copy with a clean-app copy

1

Copy the Dataverse gallery inside the workshop app

On Lego Sets - Demo 1 - DV, copy the gallery's YAML and paste it onto the workshop app's Blank Screen.

Select the gallery—not an individual control inside its template—then use the command that displays its code. Copy the complete gallery YAML and paste it onto Blank Screen.

Expect: The gallery works because the destination app already has the Dataverse connection and imported SVG.

2

Paste the same gallery into the clean app

Payoff

Copy the same gallery YAML into the blank app in your other browser tab.

Pause before fixing anything. Identify what the definition expects but the clean app does not have:

  • The Dataverse table used by the gallery's Items property
  • The image values supplied by the data
  • The imported SVG media file used as the frame

Expect: The controls appear, but the gallery data, LEGO images, or frame show errors or fail to render.

Make the records portable

3 · Remove The Data Dependency

Concept

Replace the live table with a self-contained table value

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.

Export the records and test them

1

Generate the portable table

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.

2

Add the table to the export-ready gallery

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.

3

Test the export-ready gallery in the clean app

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

4 · Carry The Dataverse Images With The Data

Concept

A Dataverse image is not an internet image URL

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.

See the failure, then export the image data

1

Switch the gallery to the Dataverse image column

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.

2

Test that image in the clean 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.

3

Generate the Base64 version

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.

4

Paste and verify the self-contained gallery

Payoff

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

5 · Remove The SVG Media Dependency

Concept

Inline SVG can replace an imported media reference

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.

Replace the imported frame and run the final test

1

Replace the frame media reference

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.

2

Verify the complete gallery in the clean app

Payoff

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.

3

Compare your result with the answer key

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

6 · Design A Snippet Worth Sharing

Concept

A snippet library is a product for other makers

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.

1

Identify the snippet's contract

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

Bonus A · Prepare The SVG In VS Code

Concept

Use the source SVG instead of hand-converting it

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.

1

Open the frame SVG in VS Code

Optional

Download the lab's LEGO frame SVG and open it in Visual Studio Code.

Expect: The SVG source is visible as editable XML.

2

Prepare it for Power Apps

Optional

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.

3

Make one value dynamic

Optional

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

Bonus B · Carry A Tiny Sound Effect

Concept

The same portability idea can apply to audio

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.

1

Add the prepared sound to a clean app

Optional

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

Where This Goes Next

Concept

Portability is the foundation; components add a maintained interface

The same decisions you made here carry into Power Apps components and component libraries:

  • Separate the reusable pattern from its live data.
  • Make dependencies and configuration explicit.
  • Give consumers clear inputs instead of hidden assumptions.
  • Package behavior and visual rules together.
  • Test reuse in a clean context.

YAML helps you move and inspect a definition. Components give reusable behavior a deliberate interface. Component libraries add a maintained distribution and update path.