When working with canvas PowerApps, you may have a need to have some date ranges set by default. A typical scenario might be where you have 2 date filters and you want to show records that occurred between those date ranges. A scenario I had to work with recently was where the customer required the default filter dates to be the first day of the current month and the last day of the current month.
Setting a date to the first day of the month is relatively straight forward. Using a combination of the Date and the Now functions, you can set up your first day of the month variable as follows:
The tricky part is getting the last day of the month. How do we know if its got 30 days or 31? What about the month of February?? What happens in a leap year!?
Turns out there is a handy undocumented “feature” when you use the Date function. If you set the day property to the number 0, it would return the last day of the previous month. So if I wanted to get the last day of February for example, my function would look as follows:
Binding that variable to a date control I had, I was able to get the last day of February accurately!
During the App in a Day sessions I’ve held there were often questions regarding the types of license that is required, based on the options/features that are part of the built solution. Based on the fact that an image is worth a thousand words, here’s how I’ve been able to easily demonstrate the basic differences between Office365 license, PowerApp P1 and P2 licenses. It’s not about all the nitty gritty details, but the base is there. In doubt always refer to Microsoft’s official documentation!
I stumbled upon a question in the PowerApps forum on how to make Gallery items clickable so I tested it out and found that it can be achieved very easily..
1. Create a gallery and bind it to Account entity in CDS..
2. Bind your Gallery to table with with a field that stores hyperlink. In this case I bind it to Account entity and field by the name of Website. 3. Select a text,label or image in the Gallery Item. On the On Select property, enter the following command
Launch(ThisItem.website) (Substitute website with the field that stores the URL)
In this case, I entered it on the Image.
4. Click save and Publish.
Now on the app, when I click on the image, it will redirect me to the website stored against the hyperlink.
If you are like me and have worked with Dynamics 365/CRM for years, approaching PowerApps might be a little bit intimidating. Part of it is that so many things that are very easy or automatically done for us in Dynamics 365 and model-driven apps need to be manually done in canvas apps. And when you search for the answer, much of the PowerApps blog and video content is from the perspective of a developer with a non-CRM background, like SharePoint.
In this series of posts, I intend to show how to do some of these things that are common in Dynamics 365 when making a canvas app. If you don’t have a Dynamics background, hopefully you will also find some benefit from them.
Related Entity Data
When building a more complex app, you frequently have the need to work with parent/child data. Say you have companies and want to show the employees working for the company, or an event and related registrations for the event.
In Dynamics and model-driven apps, this is easy.
Every record form shows a Related tab where you can see all of the entity relationships.
We can also add a subgrid to the parent entity form to display related records in-line.
Related Entity Data in Canvas Apps
When making a Canvas App, the maker needs to add visibility of related records to the app. In this example, I’m building a canvas app for a volunteer coordinator to use to manage a disaster relief team.
First, add a data connection to each table/entity that you will include in your app.
Once you have your data connections, now you can display your related entity data in your Canvas App.
Option 1: In-line
In my app I want to show skills on the person form, similar to the experience of a subgrid in Dynamics 365. That way I can easily see the skills related to a person.
In this case I add a display form and a gallery to the same page of the app
The display form displays the selected person from a person gallery on another page of the app. The skills gallery is connected to a cross-reference table of people and related skills.
This gives users of the app a subgrid-like experience in a canvas app. Note if you want to give users the ability to create child records from the subgrid gallery, you will need to add that to your app. To do this, I added the + icon to the subgrid header, and in my expression, set a context variable on the next screen with the ID of the selected contact. This allowed me to automatically set the created person skill to Barbara.
Option 2: Related page
Sometimes you don’t want to show the related information in a subgrid. Maybe your form is more information dense and you just want to go to a full list of record. This behavior is easy to reproduce with a Canvas App. In our scenario, volunteers will send updates from the disaster site about what they have done. In my app, I already have a page that users can go to see all updates from all teams.
The Update gallery has a search text input control to search and filter the update list.
We can leverage this same page for display of related records:
Set the default value of the search input textbox to a context variable.
From the parent record page, add a button or icon to navigate to the related records, in the navigate formula update the context variable referenced in the search control.
Now when volunteers click the update button from the disaster page, they see a filtered list of only the updates for the selected disaster.
So is it easier to display related entity data in model-driven apps? Yes. However, once you get used to working with canvas apps and filtering galleries, you will appreciate the extra level of control that you have over the experience, and can easily display related records in your canvas app.
Hey, Will here – just a quick post. I’ve had quite a few people come up to me asking how to enable the new “AI Builder” for Power Apps on their environment – which strikes me as slightly strange as it comes enabled as default. However, here is how you do it.
In case you missed it, the 2019 wave 2 release plan for Dynamics 365 and the Power Platform was released today. You can read James Phillip’s blog summary at https://cloudblogs.microsoft.com/dynamics365/bdm/2019/06/10/announcing-new-features-growing-demand-for-dynamics-365-and-power-platform/ and you can download the full release notes from https://docs.microsoft.com/en-us/dynamics365-release-plan/2019wave2/.
This afternoon, I was joined by MVP’s Megan Walker, Ulrik Carlsson, and Andrew Bibby to review the release plan. Watch the video below.
Providing good search capabilities is a key feature in modern business applications to support usability and end user satisfaction. We have seen how the search capabilities of the Dynamics platform has evolved from providing “Quick Search” and “Advanced File” to “Relevance Search”. The goal of the platform search features has been to support users to find the relevant information they need in the quickest and easiest form. These search features are out-of-the-box and easy to enable/configure/use. As the platform progresses to offer richer features to users and enable them to search better, the demand for richer and better search techniques grow, and we see instances where the platform capabilities cannot meet user demands with its out-of-the-box capabilities. Before going further about advanced search scenarios, you can read about the platform out-of-the-box search capabilities in this official documentation. In this article I share why we may decide to implement a search solution of our Dynamics solution using Azure Search Service.
In enterprise implementations, business applications are not the only systems used in the organization. We often see call center agents and sales representatives need to obtain their required information from various systems to service customers. Searching users in every system is a cumbersome job which may cause setbacks in end-user adaption. Integrating Dynamics with Azure search offers consolidation of search operations in one specialized search service with ability to connecting to various data sources and apply modern search techniques to find the most relevant data. A practical example of this scenario can be seen in one my recent experiences where the organization users had to search for user information in CRM, SharePoint, Sybase and a pool of CSV files.
Customized Search experience
To facilitate more user adoption, using customized search techniques are highly favorable. In all modern search engines, we see use of “Auto complete”, “Suggestions” and “highlighting” features which can be added to the Dynamics solutions search experience. Displaying search results by support of “Document Preview”, “Document Opening in a customized containers”, “Facets”, “Filter” and “Sorting” are examples that enhance your Dynamics solution’s capabilities.
Customized Search Behavior
The true power of search is demonstrated with different pieces of information are linked together to make sense of a bigger picture. Extracting words and sentences from documents including images and pdf files, extracting key phrases, people names, location names, languages and other custom entities with the help of AI is another unique feature that you can add to your Dynamics’s search capabilities. Another amazing search capability you can have in your Dynamics implementation is the ability to search based on geolocation information, i.e. you can search for all your partner network from CRM or get the location of your field service force. The beauty of implementing your own enterprise search lies in the fact that you can search information in your data stores and link them using AI to generate knowledge and better insight to your data.
Customized Search Result
Another need for customized search in your Dynamics solution to the ability to refine your search result profile. When you use AI in your search, the system gives you the power to see how relevant search results are to your search keywords. And by knowing this you can refine your search profiles to generate a different result for the same keywords. This way you train the AI engine to work better for you and enable users to get more accurate search results.
Dynamics integration with Azure Search service can be integrated in the following pattern:
Integration through web resources: These web resources will host a web application acting as a client to the search service. The web resource can be a HTML file or an iFrame hosted on forms. The important point in this approach to ensure cross-origin settings in the client application and writing your html in a secure way and according to the best practices.
Integration through custom power platform controls. You may build your own custom control which sends REST requests to the Azure Search and display results by consumes REST responses. The custom control can call Azure Search services using Actions or direct REST calls to Azure Service.
Azure Search works based on indexes and your first step is to push your CRM searchable data to Azure Search indexes. This can be done using Microsoft Flow, Microsoft App Logics, custom solutions or Azure Data Factory. I have used all these tools in my implementations, and you can opt to any of these tools based on your requirements.
Once the data is in your data store, you can create your indexes in the Azure Search. You can go for separate indexes for each data source or combine multiple data sources in one index. Each approach has its own requirements which will need to be met either in your client web application or a separate azure compute resource. Once indexing is done, you can make use Azure Search Rest API directly or using Azure API management to expose your search service to your Dynamics solution.
Summing these all up, you see as business application products get more sophisticated and organizations move from data to big data, engineers now must look for innovative approaches to implement Dynamics Solutions. Microsoft Azure along with Dynamics platform offers necessary tools to solution architects to design such solutions.
I’ve recently noticed the Solution Layers button but knew next to nothing about its functionality. It was added to my ever growing list of, “Ok, I need to check that out when I have some time!” While on a call this past week, the Solution Layers feature came up. After a brief overview on the call and some poking around afterwards, it looks to be a useful feature for developers, business analysts, and administrators.
What are Solution Layers?
Solution Layers is not some hidden, mystery feature. Microsoft has done a great job recently with their online documentation and the article titled View solution layers includes a nice quick explanation of Solution layers:
Let you see the order in which a solution changed a component.
Let you view all properties of a component within a specific solution, including the changes to the component.
Can be used to troubleshoot dependency or solution-layering issues by displaying change details for a component that was introduced by a solution change.
So the Solution Layers tool offers insight into system components and their relationships to Solution deployments. The significant bit here to me is that it shows changes to the component and when the installation or updates were introduced.
Where do I find Solution Layers?
When you select a Solution component, such as an Entity, Process, or Web Resource, or sub component such as an Entity Form or Attribute, you will now see a button labeled Solution Layers.
For example, I opened the Power Apps Checker solution in a recently provisioned demo environment. Expanding the Entities, we can see the button on the Analysis Result Detail Entity. Drilling into the Forms list, we see the tool button available with the Information main Form.
If you open the Solution Layers dialog for the Analysis Result Detail Entity, we can see a one item list of Solutions. This is a list of the Solutions to which this Entity is related.
Select the Solution listed and you can view the Analysis Result Detail Entity details that are related to the Solution.
This view provides the list of the changed properties for the Entity when the Solution was imported in the first Changed Properties ‘tab’, and the full list of Entity properties in the All Properties tab. If we open the Information Form for this Entity, we see very similar Information: a single Solution and the detailed changes of the selected Entity Form for that Solution import.
We only see one item in both the Entity and Entity Form levels because this Entity and all of its components are unique to this Solution. We can also see the list of Changed Properties is the same as the list of All Properties. This tells us that the Analysis Result Detail Entity was installed with Power Apps Checker solution and has not been affected by any other Solution installs.
That is some nice information, but not especially useful. The Solution Layers component really shines when we look at Entities that can be impacted by other solution imports. For example, a system Entity Contact can be impacted by many different Solutions on your system. Or you may have a custom Entity being deploying as part of a product or an ongoing project that will see regular changes, whether through major Solution releases or hotfix style solution deployments.
Contact is a popular Entity
If we open a different solution that contains the Contact Entity, we see the real power behind this tool. If we open the solution named Sales Navigator for Dynamics 365 Unified Interface that comes with my demo environment, and view the Contact Entity Solution Layers, we see some immediate differences.
The Contact Entity has been changed by 21 separate Solutions. The first at the bottom of the list is System, but at the top we see Active as the latest. This means that the Entity or one or more Entity sub components were updated with each of these 21 Solution imports. So, how do we see more detail on all of these Entity changes?
If we dig deeper into the Solution components, we can see more granular detail of the changes. We can drill into the Contact Forms list for this Solution and open the Contact Form Solution Layers dialog.
In this view, we can see that the Contact Form has been updated by 11 different Solution Imports. But what has been changed? Open up a solution from the list to find out:
In this view under Changed Properties, we can see detailed changes that were made with the Solution Import. In this example, we see the underlying Form JSON value was updated, and if you scroll a bit, you will also see that the Form XML. With other value types, such as numbers or boolean values, it’s easy to see the changed value.
For more complex types like Form JSON or XML, you can compare the differences to the previous Solution Layer value. Simply open the previous Solution Layer from the list and view the property value under the All Properties view using a standard text diff tool such as WinDiff or Visual Studio.
Why is this a big deal?
The Dynamics 365 CE and the Power Platform with CDS now has a built in method for change tracking of various layers of the solution components. I include the Power Platform here because when you view an Entity from a Model Driven Power Apps , you have the option of switching to Classic View. In Classic View, you can view the Solution Layers exactly as if you were working within a Dynamics 365 CE solution.
This can be incredibly useful when troubleshooting issues or just managing your own deployments. With solid DevOps practices in place, you should be able to view content like this using source code control tools. But if you are working on a project for which those practices were not well established, I can see this feature as a huge help for developers, business analysts, or system administrators.
I recommend reviewing the article listed above and playing around with the feature. For example, check out changes to solution components like Workflows where you can view the changes to the underlying XAML that contains the workflow logic.
I will be looking into it in more detail myself because I can see the possibility for some nice tools built around this capability!
Exporting/Importing data can sometimes be a tedious and time-consuming task but thanks to this feature in PowerApps, exporting data from multiple entities is as easy as ever. Huge thanks to our PowerApps SME from Barhead, Mary Rose Bagtas, for helping out. 🙂
To quickly export data, go to https://web.powerapps.com
Click on Data -> Entities
Then click on Export Data
Select the entities you want to export, then click on Export Data again.
Download the exported data and you’re good to go. 🙂
Today (3rd, Apr), one of the BIG highlight in April 2019 updates of Power Platform is released to our preview environment, called “View results of formulas and subformulas in canvas apps”.
In this post, I briefly summarise its update, How to enable/What we can/Limitation etc..
* As of 3rd, April, this experimental feature is delivered to ONLY Preview environment.
Enable experimental feature
To use this feature, go to “Advanced settings” and turn on a toggle “Enable formula bar result view”.
No need to save/reload app to use feature.
View collection records
At present, to view collection records in canvas for testing purpose, we usually add tmp gallery/data table control into app, and then see a result of our formula, such as Filter, AddColumn, LookUp…
However, as compositions get more complex, it can become difficult to understand the impact of each function on the result. This feature helps us to understand what’s happening.
To view a formula results, you will simply select some formulas/collection/variables. Below is quite simple example, if you select collection in formula bar (colTest), you will see summary of table records.
For more practical use, if we want to preview a result of multiple filter condition to some collection, select formula Filter(xxx, condition1, condition2…), then we can get result of operation.
This feature is not only for viewing collections/tables, but also getting result of other formula, such as Concatenate(text1, text2…):
We can now easily and quickly understand and debug our apps with this feature.
As far as I confirmed, there are some limitation for this feature;
Not support data source (unable to view records of some data source directly)
Not support nested collection (suppressed in view)
I think each of them is not critical for usual app making.
If I will find any further limitations/updates, will update this post.
Managed by Power Community (formerly TDG) controlled by the community.