Get Started with Microsoft Canvas App

Microsoft Canvas App – A Practical Guide for Power Platform Developers

Canvas Apps are one of the most flexible offerings in the Microsoft Power Platform. They allow developers to design custom user experiences using a low-code approach while still supporting complex business logic.

This blog explains what a Canvas App is, where it excels, where it struggles, real-world use cases, supported data sources, and provides a comprehensive overview of components and Power Fx functions, accompanied by brief explanations.

Canvas App Overview


What is a Canvas App?

A Canvas App lets you design your app screen-by-screen with full control over layout and behavior. You place controls like labels, buttons, galleries, and forms wherever you want and define logic using Power Fx.

Canvas Apps are UI-first, making them perfect for mobile apps, custom workflows, and task-based solutions.


What Makes Canvas Apps Awesome

  • Full control over UI and user experience
  • Rapid development with low-code formulas
  • Works well for mobile-first and custom apps
  • Supports many data sources beyond Dataverse
  • Easy integration with Power Automate

Where Canvas Apps Fall Short (Compared to Model-Driven Apps)

  • Handling complex relational data is harder
  • No built-in business process flows
  • Security must be handled manually in some cases
  • Performance can degrade with large datasets

Business Scenarios – When to Use Canvas Apps

  • Field inspection and survey apps
  • Employee self-service portals
  • Approval and request management
  • Inventory and asset tracking
  • Custom mobile apps for sales teams

Data Sources Supported by Canvas Apps

  • Dataverse
  • SharePoint
  • Excel (OneDrive / SharePoint)
  • SQL Server (Azure & On-Prem via Gateway)
  • Microsoft Lists
  • Dynamics 365
  • Custom APIs using Custom Connectors

Canvas App Components (Purpose + Working)

Label

Displays static or dynamic text on the screen.


Text = "Hello " & User().FullName

Text Input

Accepts user input such as names, emails, or numbers.


TextInput1.Text

Button

Triggers an action when clicked.


OnSelect = SubmitForm(Form1)

Gallery

Shows a list of records in a repeating layout.


Items = Employees

Form (Edit / Display)

Used to create, update, or view records.


DataSource = Employees

Dropdown

Allows selection of a single value from a list.


Items = Distinct(Employees, Department)

ComboBox

Advanced dropdown with multi-select and search.


SelectedItems

Date Picker

Lets users select a date.


SelectedDate

Toggle

Captures Yes/No input.


Toggle1.Value

Checkbox

Used for boolean selections.


Checkbox1.Value

Icon

Clickable icon used for actions.


OnSelect = Remove(Employees, ThisItem)

Timer

Runs logic after a set time interval.


OnTimerEnd = Refresh(Employees)

Component (Custom)

Reusable UI with encapsulated logic.


Input / Output properties


Top 25 Most Used Power Fx Functions

1. Patch

Creates or updates records in a data source.


Patch(DS, Defaults(DS), {Name:"Ajay"})

2. SubmitForm

Saves form data to the connected data source.


SubmitForm(Form1)

3. Collect

Adds records to a local collection.


Collect(colData, DS)

4. ClearCollect

Clears and reloads a collection.


ClearCollect(colData, DS)

5. Filter

Returns records that meet a condition.


Filter(DS, Status="Active")

6. LookUp

Finds the first matching record.


LookUp(DS, Email=User().Email)

7. Remove

Deletes a specific record.


Remove(DS, ThisItem)

8. RemoveIf

Deletes records based on condition.


RemoveIf(DS, Status="Inactive")

9. UpdateIf

Updates records conditionally.


UpdateIf(DS, Status="New", {Status:"Closed"})

10. If

Runs logic based on conditions.


If(IsBlank(txt.Text), Notify("Required"))

11. Switch

Executes logic based on multiple conditions.


Switch(Role, "Admin", true, false)

12. Navigate

Navigates to another screen.


Navigate(Screen2)

13. Notify

Displays in-app notifications.


Notify("Saved", NotificationType.Success)

14. Set

Creates or updates global variables.


Set(varUser, User().Email)

15. UpdateContext

Creates screen-level variables.


UpdateContext({locVisible:true})

16. Concurrent

Runs multiple actions in parallel.


Concurrent(Refresh(A), Refresh(B))

17. IsBlank

Checks if a value is blank.


IsBlank(TextInput1.Text)

18. IsEmpty

Checks if a table or collection is empty.


IsEmpty(colData)

19. CountRows

Counts records in a table.


CountRows(Gallery1.AllItems)

20. Sum

Calculates total of numeric values.


Sum(Sales, Amount)

21. Text

Formats values as readable text.


Text(Today(), "dd-mm-yyyy")

22. Value

Converts text to numeric value.


Value(TextInput1.Text)

23. Today

Returns current system date.


Today()

24. Now

Returns current date and time.


Now()

25. Refresh

Reloads latest data from source.


Refresh(DS)

Remember, every great Canvas App started with a single control on a blank screen. Experiment, explore, and don't be afraid to try new ideas.

Keep learning, keep creating, and enjoy the ride! 🌟



🌐 Understanding Dynamics 365 CE & Dataverse

 Whether you're just starting your journey as a Dynamics 365 Developer or preparing for that big interview, everything begins with a clear understanding of what you're actually building on. That means understanding what Dynamics 365 CE is, and more importantly, how Dataverse holds it all together.

Let’s break it down.

💡 What is Dynamics 365 CE?

When we say Dynamics 365 Customer Engagement (CE), we’re talking about a collection of Microsoft business applications focused on managing customer-facing processes. Think about:

  • 💼 Sales – for tracking leads, opportunities, and closing deals

  • 🎧 Customer Service – for handling cases, SLAs, and knowledge management

  • 📣 Marketing – for managing campaigns, segments, customer journeys

  • 🧰 Field Service – for dispatching technicians and managing assets

  • 📊 Project Operations – for managing resource utilization and project billing

All of these apps don’t live in isolation. They run on a shared platform called Dataverse.


🧠 So, What Exactly Is Dataverse?

You can think of Dataverse as the "database with superpowers."

It's not just where data is stored — it's the backbone of all Power Platform applications and Dynamics 365 CE modules. It handles things like:

  • Tables (Entities) – like Contact, Account, or Case

  • Relationships – one-to-many, many-to-many

  • Security roles & access control

  • Business logic – workflows, business rules, calculated fields

  • APIs – for developers to read/write/update data

🔍 Fun Fact: Dataverse was formerly known as Common Data Service (CDS). Microsoft rebranded it, but many principles are the same.


🏗️ Dataverse = A Developer’s Playground

If you're a D365 developer, here’s what makes Dataverse special for you:

  • You can customize tables, fields, and relationships without writing code.

  • You can write plugins to run server-side logic during operations like create/update/delete.

  • You can integrate external systems using the Web API or the SDK.

  • You can build rich Power Automate flows or Power Apps that talk directly to Dataverse.

In other words, it gives you the flexibility of a relational database with the power of a business platform.


🔐 Security Model in Dataverse

Security isn’t an afterthought — it’s baked in.

Dataverse provides a layered security model:

  • Business Units – Logical segregation of users (e.g., by department or geography)

  • Security Roles – Define what actions a user can perform (Read, Write, Delete, etc.)

  • Teams – Users can belong to multiple teams and inherit access

  • Hierarchy Security – Managers can access records of their reports

🛡️ This model ensures that data access is well-governed — a crucial need for enterprise-grade apps.


💬 Real-World Analogy

Imagine you're building an app to manage real estate assets. Dataverse lets you:

  • Create a A Property table with custom columns like Area, Price, Location

  • Link each property to an Owner (Account)

  • Restrict certain users to only see properties in their city (via business units)

  • Run a plugin to auto-calculate stamp duty based on the price

All of this happens inside Dataverse, without needing to build your own backend from scratch.


🎯 Interview Questions

1. What are the core components of the Power Platform?
Ans. Power Apps, Power Automate, Power BI, Power Pages, and Dataverse.

2. What is Dataverse?
Ans. Cloud-based data platform for storing and managing business data.

3. Difference between Dataverse and traditional SQL?
Ans. Dataverse offers metadata-driven logic, relationships, security, and integration support.

4. How is metadata stored and managed in Dataverse?
Ans. Metadata (like table schema, relationships) is stored in system tables and drives the platform's dynamic behavior.

5. What’s the difference between model-driven and canvas apps?
Ans. Model-driven apps are data-first (based on Dataverse), canvas apps are design-first (pixel control).

6. What’s the role of business units?
Ans. They define the data access boundary for users.

7. What is a business unit in D365 CE and how does it impact data access?
Ans. It creates a hierarchy that controls the visibility of records to users based on their assigned unit.

8. Can we control field-level security in Dataverse?
Ans. Yes, via Field Security Profiles

9. What is the difference between record ownership and access?
Ans. Ownership gives control over a record; access (via sharing, role, or team) allows interaction without owning.

10. What are Access Teams vs Owner Teams?
Ans. Owner Teams own records; Access Teams are temporary and used for granting record-level access dynamically.

11. What is the role of a solution in D365 CE?
Ans. A container to group and transport customizations like tables, fields, views, and flows.

12. Managed vs Unmanaged solutions?
Ans. Managed = for deployment, Unmanaged = for development.

13. Can we export a solution with data? If yes, how?
Ans. No, solutions don’t carry data. Use Data Export Service, Azure Data Factory, or dataflows.

14. What is patching in managed solutions?
Ans. Patches allow delivering small updates over a base managed solution, useful for hotfixes.

15. What is the difference between a patch and a clone of a solution?
Ans. A patch makes a small update to an existing solution; a clone creates a new major version that includes all prior patches.

16. Can you export a managed solution from a production environment?
Ans. No, only unmanaged solutions can be exported. Managed solutions are meant for deployment, not modification.

17. What happens if two managed solutions customize the same component?
Ans. The solution installed last wins (layering). Managed conflicts are resolved via solution layering.

18. What happens when you delete a managed solution from an environment?
Ans. All components included in that solution (that weren’t used elsewhere) are removed, making it risky in production.

18. Can you explain the solution layering model in D365 CE?
Ans. D365 uses a layered solution model:
        System Layer → Managed → Unmanaged.
        The top-most layer takes precedence.

19. What are polymorphic lookups in Dataverse (also called Customer or Regarding)?
Ans. These allow referencing more than one type of table (e.g., Customer can link to either Account or Contact).

20. Which APIs can developers use to access Dataverse?
Ans. Web API (REST), SDK via IOrganizationService (SOAP), and Data Export (for external sync).

21. What are some limitations of Dataverse developers should be aware of?
Ans. Some key limitations:
  • API limits (service protection throttling)
  • Complex joins are harder than in SQL
  • Plugin execution timeout (~2 minutes)
  • Storage can become expensive at scale



How to Get and Set Field Values in Dynamics 365 CRM using JavaScript

Customizing Dynamics 365 CRM using JavaScript allows you to dynamically retrieve and update field values, improving user experience and automation. This blog provides JavaScript examples for getting and setting different field types in Dynamics 365.

Getting Started

To begin, use the following function to get the form context:


function GetSet(executionContext) {
    var formContext = executionContext.getFormContext();
}

Now, let's explore different field types and how to work with them.

How to Get Latitude and Longitude from an Address Using Bing Maps API in JavaScript for D365

 

Getting Latitude & Longitude from an Address Using Bing Maps API


In Microsoft Dynamics 365, capturing latitude and longitude based on a given address is crucial for various business scenarios, such as the following:

  • Customer Location Tracking: Storing precise geolocation details for customers.

  • Field Service Optimization: Assigning technicians based on customer locations.

  • Sales Territory Management: Mapping sales territories.

To achieve this, we use the Bing Maps API to convert an input address into geographic coordinates (latitude and longitude) and auto-populate them in Dynamics 365 fields.