Power Apps Part 2- Building Your First App in Dynamics 365

1. Introduction

In our previous blog, we explored the fundamentals of Power Apps, focusing on its capabilities, benefits, and role in empowering organizations to build custom applications without extensive coding knowledge. Today, we take the next step on this journey: learning how to build your first app using Power Apps within Dynamics 365 (D365).

Power Apps, when integrated with Dynamics 365, allows users to access data stored in their D365 environment, creating powerful apps that improve workflows and streamline business processes. In this guide, you’ll learn how to set up Power Apps, design an application, and connect it to Dynamics 365 data — all within a few simple steps.

By the end of this article, you’ll have a functional app built from scratch, capable of accessing and managing your Dynamics 365 data, such as customers, leads, or opportunities.

2. Setting Up Your Environment

Before diving into building your app, it’s essential to set up the right environment. Power Apps integrates directly with Dynamics 365, making it easy to pull in your organization’s data and automate processes. Here’s how to get started:

a. Access Power Apps and Dynamics 365

  • If you’re already using Dynamics 365, you have access to Power Apps as part of the Microsoft Power Platform. Start by navigating to Power Apps or accessing it through your Office 365 app launcher.
  • Ensure you have the necessary permissions to create apps within your organization’s D365 environment. This may require obtaining a Power Apps or Dynamics 365 license if you don’t already have one.

b. Set Up a New App Environment

  • Once inside Power Apps, select Create from the left-hand navigation panel.
  • You’ll be prompted to choose an app type. For this tutorial, we’ll focus on Canvas Apps, which allow you to design your app from scratch using a drag-and-drop interface.
  • Name your app and select the format (either Tablet or Phone, depending on your target audience and use case).

c. Connecting to Dynamics 365

  • One of the strengths of Power Apps is its ability to integrate directly with your D365 data. To connect your app to D365, select Add Data in the Data panel on the right side of your screen.
  • From the list of connectors, choose Dynamics 365 and sign in using your organization’s credentials.
  • You’ll now have access to a variety of entities from D365, such as Accounts, Leads, and Opportunities. These entities will form the data backbone of your app.

d. Understanding Connectors

  • Connectors are the key to unlocking the data within your Dynamics 365 environment. These allow Power Apps to communicate with other services and applications, such as SharePoint, Microsoft Teams, or even third-party services.
  • With D365 connected, you can pull in live data, modify records, and build features that directly impact your business operations.

Once your environment is set up and connected, you’re ready to start designing your app! In the next section, we’ll explore how to lay out your app, customize screens, and build the user interface.

3. Designing the App

Now that your environment is set up and connected to Dynamics 365, it’s time to dive into the fun part: designing your app! Power Apps offers a highly flexible canvas where you can drag and drop components to create an intuitive user experience. In this section, we’ll walk through the basic steps to design your app layout, customize screens, and integrate D365 data.

a. Choosing Your App Type: Canvas vs. Model-Driven Apps

Before starting, it’s important to understand the two main types of apps you can build in Power Apps:

  • Canvas Apps: Offer complete flexibility in terms of design, allowing you to build apps from a blank canvas. You control every element of the UI, including where buttons, forms, and galleries are placed.
  • Model-Driven Apps: These are built based on your data model and business processes. The layout is predefined but optimized for creating apps quickly using D365 entities.

For this guide, we will focus on Canvas Apps, which provide maximum flexibility when it comes to designing the user interface.

b. Creating a Canvas App

  • After selecting Canvas App during the setup, you will enter the app design studio. The blank screen you see is your canvas, where you’ll place controls like buttons, galleries, and forms.
  • Begin by adding a screen. In the left-hand pane, click on the “+” icon and select Screen. This will be the main page of your app. You can choose from several templates (e.g., List Screen, Form Screen) or start with a blank screen.

c. Adding Data Sources

  • To display or manipulate data from Dynamics 365, you’ll need to add data sources. If you haven’t already, click on the Data tab in the right-hand panel, select Add Data, and connect your app to your D365 entities (e.g., Accounts, Contacts, Leads).
  • Once the data source is added, you can start using these entities within your app. For example, if you want to show a list of leads, use a Gallery control.
    • Go to the Insert menu, click Gallery, and choose the layout you prefer (Vertical, Horizontal, etc.).
    • In the gallery’s data property, bind it to the D365 entity (e.g., Leads). Power Apps will automatically pull in the relevant data fields, such as names, email addresses, or statuses.

d. Customizing the User Interface

 

  • Customization is where Canvas Apps really shine. You can drag and drop components like buttons, text fields, and forms onto your canvas and arrange them however you like.
  • Want to add a button to navigate to a new screen? Go to Insert, select Button, and drag it onto the screen. You can adjust its properties, like color and size, in the right-hand properties pane.
  • To make the button functional, add a simple action using PowerFX (the formula language in Power Apps). For example, to navigate to another screen, select the button and enter the formula Navigate(Screen2).

e. Creating Forms to Manage Data

  • Forms are essential if you want to allow users to view or modify D365 data within the app. To add a form, go to Insert, choose Form, and select either an Edit Form (for editing data) or View Form (for read-only data).
  • Connect the form to the data source by selecting your D365 entity (e.g., Opportunities).
  • You can choose which fields from the entity you want to display and customize the layout, such as adding dropdowns, text inputs, or checkboxes. This allows users to interact with D365 data directly from your app.

With your app’s design taking shape, the next step is to work with the data, ensuring it’s properly displayed and functional within your app. In the following section, we’ll focus on how to manage D365 data, including how to display, add, and edit records.

4. Working with Data

Now that your app’s layout is coming together, it’s time to focus on one of the most critical aspects of any application: data. In this section, we’ll walk through how to work with Dynamics 365 data in your app. You’ll learn how to display data, allow users to add or edit records, and ensure data integrity.

a. Displaying Data in Galleries and Forms

  • Galleries and forms are the two primary ways to display and interact with data in Power Apps.
  • Galleries are great for showing lists of items. If you’ve already connected your app to a D365 entity (e.g., Leads or Accounts), you can bind the gallery to the data source.
    • To do this, select your gallery, go to the Items property in the formula bar, and enter the name of your data source. For example, Leads.
    • The gallery will automatically display the data fields (e.g., Lead Name, Email Address) from the entity. You can customize the layout to show only the fields you want by selecting the gallery and modifying its data cards.
  • Forms allow users to view, edit, or create records. There are two main types of forms:
    • View Form: Displays data in read-only mode.
    • Edit Form: Allows users to modify existing records or create new ones.

b. Binding Forms to Data

  • To bind a form to a data source, first insert a form from the Insert menu and choose either View Form or Edit Form.
  • In the right-hand Data Source panel, choose your D365 entity (e.g., Opportunities) as the data source.
  • You can then customize the fields that appear in the form. Click on the form, and under the Fields panel, select the columns you want users to see or edit. This flexibility lets you tailor forms to fit specific business processes or user needs.

c. Creating New Records

  • Allowing users to create new records from within the app is simple with the Edit Form control.
  • Add a button labeled “New Record” and set its OnSelect property to this formula: NewForm(EditForm1). This resets the form, enabling users to input new data.
  • Once the form is filled out, another button (e.g., “Submit”) should be added. Set this button’s OnSelect property to SubmitForm(EditForm1). When clicked, this action will save the new record directly to the D365 entity.

d. Editing Existing Records

  • To edit existing records, you need to set up a way for the user to select a record from the gallery and populate the form with its details.
  • To do this, add a button in the gallery item that lets users click and view record details. Set the button’s OnSelect property to EditForm(EditForm1); Navigate(FormScreen), where FormScreen is the screen displaying the form.
  • The form will then load the selected record, allowing users to edit and submit changes.

e. Adding Simple Validation

  • Power Apps allows you to add simple validation to forms, ensuring data integrity. For instance, if you want to ensure a required field (like a customer name) is filled out, you can set validation rules.
  • Select the field in your form, go to the Advanced properties, and find the Required option. Set it to true. If a user tries to submit the form without filling in that field, they’ll see an error message.
  • You can also set up custom validation logic using PowerFX. For example, to ensure that an email address follows a valid format, you could use a formula like IsMatch(EmailInput.Text, “^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$”).

With the ability to view, add, and edit records now set up, your app becomes a powerful tool for working with real-time data from Dynamics 365. In the next section, we’ll explore adding automation and workflows to enhance your app’s functionality.

5. Adding Logic and Automation

With your app now displaying and interacting with Dynamics 365 data, it’s time to enhance its functionality by adding logic and automation. Power Apps, in combination with Power Automate, enables you to build workflows that respond to specific events, such as sending notifications, automating tasks, or even updating records in D365 without manual input. This section will guide you through adding logic to your app and creating a simple workflow using Power Automate.

a. Introduction to Power Automate

  • Power Automate (formerly Microsoft Flow) is a tool that allows you to automate workflows between your applications and services. When integrated with Power Apps, it can handle complex tasks like triggering an email, updating D365 records, or syncing data between systems — all without requiring user intervention.
  • You can easily embed Power Automate flows in your Power Apps to enhance your app’s capabilities.

b. Adding Business Logic with PowerFX

  • PowerFX is the formula language used in Power Apps to handle simple logic. For example, you can control how data is displayed or define actions when users click a button.

Example: If you want to show a confirmation message when a record is successfully submitted, use this formula in the OnSuccess property of the form:
PowerFX
Notify(“Record submitted successfully!”, NotificationType.Success);

You can also create more complex logic, like filtering data dynamically. For example, to display only active leads from your D365 Leads entity in a gallery, you can use the following formula in the Items property:
PowerFX
Filter(Leads, Status = “Active”);

 

c. Creating a Simple Workflow with Power Automate

  • Let’s add some automation to your app using Power Automate. For this example, we’ll create a workflow that sends an email notification when a new record is created in Dynamics 365.

Steps to Create a Flow:

  1. Open Power Automate: In Power Apps, go to the Action menu and select Power Automate. You’ll be redirected to the Power Automate portal.
  2. Create a New Flow: Click on Create, and select Automated Flow. Choose a trigger that suits your needs — for this example, select When a record is created (triggered by a new record in D365).
  3. Select the Entity: Choose the D365 entity you’re working with (e.g., Leads or Accounts). Every time a new record is added to this entity, the flow will trigger.
  4. Add Actions: Add an action to the flow, such as Send an email. Configure the email content, including recipients and the message body, which can include details from the new D365 record.
  5. Test the Flow: Once the flow is complete, save it and test the automation by adding a new record to the D365 entity through your app. The flow should automatically send an email.

d. Integrating Power Automate Flows in Power Apps

  • After creating a flow in Power Automate, you can easily integrate it into your app. In Power Apps, go back to your app and open the screen or button where you want the automation to trigger.

In the button’s OnSelect property, use the Power Automate option to call the flow you created. For example:


‘YourFlowName’.Run(LeadName.Text, LeadEmail.Text);

  • This connects your app to the automated workflow, ensuring the logic you’ve set up in Power Automate runs whenever the button is clicked or a certain action occurs.

e. Advanced Automation

  • Once you’re comfortable with basic workflows, you can explore more advanced scenarios like:
    • Updating records across multiple systems when certain conditions are met.
    • Triggering flows based on complex events or multi-step approvals.
    • Integrating AI models or external APIs to add intelligence to your app.

With automation now integrated into your app, you’ve taken a significant step toward creating a more dynamic and efficient tool for your users. In the next section, we’ll cover how to test and publish your app so that others in your organization can start using it.

6. Testing and Publishing the App

Now that your app is designed and enhanced with automation and business logic, it’s important to thoroughly test the app before releasing it to your organization. Testing ensures that the app works as expected and catches any potential issues before users interact with it. Once testing is complete, you can publish the app and make it available to your team.

a. Testing the App

  • Preview Mode: Power Apps offers a preview mode that allows you to test the app in real time.
    • Click the Play button in the top-right corner of the screen to enter preview mode. This simulates how the app will behave on different devices.
    • Interact with the app by navigating through screens, submitting forms, and triggering automated workflows to ensure everything works as expected.
  • Testing Data Interactions:
    • Verify that all data bindings are correctly configured by interacting with the data you’ve pulled from Dynamics 365.
    • Ensure that galleries display the correct data, forms allow users to submit and update records, and that any automated workflows, such as email notifications, are working properly.
    • Double-check that validation rules (e.g., required fields) are functioning as intended.
  • Testing Automation:
    • Test any Power Automate flows you’ve integrated. For example, if you’ve set up an email notification when a new record is created, verify that the flow runs successfully when you add a new record through the app.
    • You can view the flow history in Power Automate to confirm that it has triggered as expected.
  • Debugging Common Issues:
    • Data not displaying: If your app isn’t showing data correctly, verify that the data source is properly connected and that the correct entity is selected.
    • Form submission errors: Ensure all required fields are filled out and that the form is properly connected to the data source.
    • Automation not triggering: Check Power Automate to ensure the flow is correctly set up and linked to your app’s triggers.

b. Publishing the App

Once you’re satisfied with your testing, you can publish the app for your organization. Here’s how:

  • Save and Publish:
    • Click the File menu and select Save to ensure your app is up to date.
    • After saving, select Publish to the web. This will make your app available to users within your organization.
  • Sharing the App:
    • After publishing, go to the Share option in the left-hand menu.
    • You can invite specific users or groups to access the app by entering their email addresses.
    • Define the permissions for each user (e.g., whether they can edit the app or only view it).
  • Testing on Devices:
    • Power Apps automatically adapts apps to different devices, such as phones and tablets. However, it’s a good idea to test the app on different devices to ensure that the layout is responsive and works well across platforms.
    • You can test the app directly on mobile devices by downloading the Power Apps mobile app from the Apple App Store or Google Play Store, logging in, and accessing your published app.

c. Updating the App After Publishing

  • Apps in Power Apps can be continuously improved. If you need to make changes after publishing, simply go back into the app editor, make your updates, and republish.
  • Users will receive the latest version of the app without needing to reinstall or manually update it

Guide to Optimizing SEO for Higher Website Rankings in Search Results

In the digital era, SEO (Search Engine Optimization) is an indispensable part of any business’s marketing strategy. Optimizing SEO helps your website appear higher on search results from Google and other search engines, attracting organic traffic and increasing conversion opportunities. With many years of experience in SEO, I will guide you from basic to advanced SEO techniques, with specific examples to make them easy to understand.

Cách chọn dịch vụ SEO Hosting phù hợp nhất để tối ưu SEO - 123HOST

Why SEO Optimization is Important for Your Website

  1. Increase organic traffic: Most users click on the top results on a search page. Optimizing SEO gives your website the chance to appear in those top positions.
  2. Boost trust and credibility: A high-ranking website is often perceived as more reliable by users.
  3. Save on advertising costs: SEO helps you attract traffic without paying for each click (PPC).
  4. Improve user experience: SEO optimization not only focuses on search engines but also improves the user experience, keeping visitors on your site longer.

SEO Techniques from Basic to Advanced

1. Keyword Research

Keyword research is the foundation of any successful SEO strategy. You need to identify the keywords that your potential customers are using when searching for products or services.

  • Example: If you own a sports shoe store, keywords to optimize for could be “men’s running shoes,” “buy running shoes,” or “gym shoes.” Tools like Google Keyword Planner or Ahrefs can help you analyze keyword search volumes and competition.

2. Content Optimization

Content remains “king” in SEO. However, it’s not just about creating engaging content; it also needs to be optimized for your primary and related keywords.

  • Example: If you’re writing about “how to choose running shoes,” make sure the keyword “choose running shoes” appears naturally in the title, H1, H2 tags, and throughout the content. Include related keywords like “best running shoes,” “men’s running shoes” to give Google a better understanding of your overall content.

3. Page Speed Optimization

Google prioritizes websites with fast loading speeds. Optimizing your website’s loading speed not only benefits SEO but also enhances the user experience.

  • Example: Use tools like Google PageSpeed Insights to check your site’s performance and follow the suggestions for improvement, such as optimizing images, enabling browser caching, or minimizing CSS and JavaScript.

4. Internal and External Linking

Internal linking helps users navigate your website more easily and helps Google understand your site’s structure. External links (backlinks) from reputable websites are essential for increasing your site’s credibility.

  • Example for internal links: If you have a blog post on “how to choose running shoes,” link it to other related articles like “best running shoes” or “Nike running shoes reviews.”
  • Example for backlinks: Collaborate with reputable blogs or websites to get backlinks. For instance, you could guest post on sports or fashion websites and include links back to your article.

5. On-page SEO Optimization

This involves optimizing elements on your website such as title tags, meta descriptions, heading tags (H1, H2…), and image alt text.

  • Example: When optimizing a title tag for a post about “running shoes,” the title could be “Top 10 Best Running Shoes of 2024,” and the meta description might be “Discover the top 10 best running shoes with affordable prices, perfect for both beginners and pros.” Ensure that the H1 tag includes the main keyword, such as “best running shoes.”

Advanced Techniques

6. Mobile SEO Optimization

Nowadays, a significant percentage of traffic comes from mobile devices. Google prioritizes websites that are mobile-friendly.

  • Example: Use Google’s Mobile-Friendly Test to check if your website is mobile-friendly. Ensure all content displays properly on small screens without users needing to zoom in or scroll horizontally.

7. Schema Markup Optimization

Schema markup helps Google better understand your content and can display additional information as Rich Snippets in search results.

  • Example: If you have a product page for running shoes, you can add schema markup to show details like price, ratings, and reviews directly in the search results. This can improve your click-through rate (CTR).

8. Local SEO Optimization

If your business offers services or products in a specific location, local SEO is essential. Make sure your business is listed on Google My Business and optimize your address, phone number, and business hours.

  • Example: A sports shoe store in Hanoi should optimize its Google My Business listing with keywords like “sports shoe store in Hanoi” and encourage customers to leave reviews to boost credibility.

9. Technical SEO Optimization

Technical SEO ensures that your site is easily crawled and indexed by Google. Key elements include optimizing your sitemap, robots.txt, and using HTTPS.

  • Example: Creating an XML sitemap helps Google understand the structure of your website and makes it easier to crawl. Make sure your site is using HTTPS to improve trustworthiness.

10. E-A-T Optimization (Expertise, Authoritativeness, Trustworthiness)

E-A-T is an important factor used by Google to assess the quality of a website. Demonstrating expertise, authority, and trustworthiness in your field is essential for high rankings.

  • Example: If you run a blog on running shoes, ensure that articles are written by experts in the field, regularly update the information, and provide accurate data to establish authority and build trust.

Conclusion

SEO optimization is an ongoing process that requires persistence and strategic thinking. By applying these techniques, from basic keyword research to advanced technical SEO and E-A-T optimization, you’ll have the chance to improve your website’s rankings and drive more organic traffic. The key is to constantly update and adjust your SEO strategy to keep up with Google’s evolving algorithms.