The post Automatically sending Power Apps cards to Microsoft Teams channels using Power Automate Flow appeared first on Microsoft Dynamics 365 Blog.
]]>In this blog, we have explained how to send these cards to the Microsoft Teams channel using Power Automate Flow. We have taken an example where we automate the process of sending an employee information Card when a custom entity employee record gets created.
Microsoft introduced new connector in the power automate flow named as Cards for Power Apps.
This connector is used to create or get card instances with the input variables, and it will return the dynamic content of the card instance.
You can follow the below steps to create Power Automate Flow to send cards to the Microsoft Teams channel.
Step 1: Sign in to PowerAutomate using your credentials and select your environment.
Step 2: Click on My Flows >> New Flow >> Automated Cloud Flow.
Step 3: Give the name and choose the flow’s trigger.
Step 4: Set the trigger. In the example screenshot below, the trigger is when a new custom employee record is created.
Step 5: In new step, search for Cards for Power Apps, then click on Expand button.
Step 6: Select Cards for Power Apps.
Step 7: Select Create Card Instance (preview).
Step 8: Select the card that you want to send. Set the body input variable. In this example, we set the Account Name value of the newly created account record.
Step 9: In the next step, search for Microsoft Teams connector and select the action as Post Card as a chat or channel.
Step 10: Set the Power Apps (Preview) in Post as field, and set Channel in Post in field. You can select your team and channel from the dropdown. After that, set the card instance that we created in the earlier step.
After this power automation flow gets created, it will be triggered when the new employee record gets created, and the card will be sent to the Microsoft Teams channel as shown in the below screenshot.
Thus, in the above blog, we learned how to send Cards to Microsoft Teams channel by using Power Automate Flow.
The post Automatically sending Power Apps cards to Microsoft Teams channels using Power Automate Flow first appeared on Microsoft Dynamics 365 CRM Tips and Tricks.
Go to Source and hit them a thumps up
The post Automatically sending Power Apps cards to Microsoft Teams channels using Power Automate Flow appeared first on Microsoft Dynamics 365 Blog.
]]>The post Transfer online files to a local device using ‘Download function’ in Power Apps appeared first on Microsoft Dynamics 365 Blog.
]]>Let’s see how to use this feature in everyday life.
Suppose our organization wants to create an App (Canvas or Model Driven App) in Dynamics CRM. We have a file on the web that we want to enable our users to download regularly through our App. This would get them updated data by simply clicking on Download File.
This can be achieve using the below steps:
Step 1:
Create an App in CRM (Canvas or Model Driven App).
Step 2:
Insert Label Control into App.
Step 3:
In Power Apps, select the label and in Power Fx, onSelect of label, add Formula with Address as a Parameter “Download (Address)”.
Address– The URL address of a document or file to download
Step 4:
Once you publish the app, you can click on Download File to download it.
With the help of download function in Power Apps, we can easily download online files to local devices.
The post Transfer online files to a local device using ‘Download function’ in Power Apps first appeared on Microsoft Dynamics 365 CRM Tips and Tricks.
Please visit the Source and support them
The post Transfer online files to a local device using ‘Download function’ in Power Apps appeared first on Microsoft Dynamics 365 Blog.
]]>The post How to permanently delete Disabled Users from the Power Platform appeared first on Microsoft Dynamics 365 Blog.
]]>The main purpose of this feature is as follows-
Whenever we delete any user it remains in the environment as a disabled user which may take some space. After deleting the unwanted (disabled) user some storage will free up and you will be able to use the license for other users within the environment.
Let’s see how it works, first, we see how to create new users from Microsoft 365 admin center and add them to the power platform environment.
Login into Microsoft 365 admin center -> Users -> Add a User -> Create a User
Now Login into https://admin.powerplatform.microsoft.com/ -> Select the Environment -> Settings -> Users + Permissions -> Users -> Add User
Once a user is added to the power platform then the same will get added to Azure Portal
Now we will see how to delete the user from Microsoft 365 admin center and see the status in the power platform and Azure Portal.
Login into Microsoft 365 admin center -> Users -> Active Users -> Select User -> Click on Delete User
When you delete the user from the admin center it will be soft-deleted and you can restore the user within 30 days after the deletion. Once you click on Delete User you will get confirmation as shown below.
Once a user is deleted from the admin center check the status in the power platform
Select deleted user -> Run Diagnostics
Here, you can see the status of the user shown as Disabled, which means the user is still in the power platform and not deleted yet, and also the user will get deleted from Azure Active Directory.
When the user is deleted from the admin center then the user remains active and shown in the power platform i.e. environment only the status is shown as disabled.
Now we will see how to delete users from the power platform by using the “Disable Deleted User” preview feature.
Before enabling the “Disable Deleted User” preview feature, you can see the following filters under users.
Select the Environment -> Settings -> Product -> Features -> Enable Delete disabled users (preview) -> Save
Now we need to delete the user permanently which is created in the admin center by connection to the Azure Active Directory admin center. Login into Azure Active Directory admin center
Users -> Deleted Users -> Select user -> Delete Permanently
Now user gets deleted permanently from Azure Active Directory but it will be still present in the power platform but in a disabled state.
Once the user enabled the feature, you will be able to see more filters as shown. Click on “Users, not in AAD but exist in the environment” here you will be able to see the user which is deleted from AAD select the same user, and click on Delete User.
This feature allows us to delete the user with a disabled status in the environment thus freeing-up storage from the environment.
The post How to permanently delete Disabled Users from the Power Platform first appeared on Microsoft Dynamics 365 CRM Tips and Tricks.
Please visit the Source and support them
The post How to permanently delete Disabled Users from the Power Platform appeared first on Microsoft Dynamics 365 Blog.
]]>The post Editable Grid feature properties of Power Apps Grid control appeared first on Microsoft Dynamics 365 Blog.
]]>In our previous blog, we saw how users can edit records within the grid and do infinite scrolling until they find the records they are interested in. Also, they can configure editing, filtering, and navigation properties while adding control.
This blog will show some new properties of Power Apps Grid control while configuring it. Using these properties, it is possible to customize the visual appearance of columns based on specific requirements.
If a salesperson wants to sort data according to primary field initials and by visualizing the records wants to copy and paste it into other applications like excel, word, etc., using a customizer control, the developer (by using a script) can color code the columns’ values and visualize it on grid control.
Follow the same steps as mentioned in the previous blog to add Power Apps Grid Control.
1. Allow Range Selection: This property is by default set to yes. You can select a set of records or a subset of the grid to copy data to other applications using this property.
You can paste data to other applications like excel.
2. Enable jump bar: This property is by default set to No. An alphabetical list can be displayed at the bottom of the views or subgrid using this property.
Below is the screenshot of the jump bar enabled.
3. Enable Pagination: This property is by default set to No. Data can be browsed using modern scrolling (infinite scrolling) and paging buttons by setting this property. You have to set this property as Yes to disable infinite scrolling.
4. Enable Status column: This property is by default set to To hide the Status column( Record selection checkbox) you have to set this property as No.
4. Show data type icons: This property is by default set to No. By setting this property to Yes Data type icons will be displayed in the column header. On hover of the icon, the datatype name will be displayed.
5. Customizer Control: In the customizer control property, several columns in a grid can have their visuals or interactions changed by linking to a single customizer PCF control.
6. Enable option set color: This property is by default set as No. When the Enable OptionSet color property is enabled, the background color of each value in the choice column will be shown with its corresponding value. If you are enabling this property for a table, be sure to check the color configuration for each choice column to ensure that the content is accessible and easy to read.
Below is the screenshot after the option set color is enabled.
Using this property users can customize its Power Apps Grid control, which will eventually replace all read-only and editable grids in model-driven apps.
Go to Source and hit them a thumps up
The post Editable Grid feature properties of Power Apps Grid control appeared first on Microsoft Dynamics 365 Blog.
]]>The post Use of async-await in virtual PCF control appeared first on Microsoft Dynamics 365 Blog.
]]>Let’s take an example where we will create a virtual drop-down PCF control. We will be showing the entity attributes as options in our drop-down control. In the example below, we have created an async function GetEntityAttribute which will be responsible for getting the entity attributes to list out in our PCF drop-down control.
If we call our async function GetEntityAttribute in the updateView() as follows, we will not get the options with dropdown as shown in the below image.
UpdateView() Then:
public updateView(context: ComponentFramework.Context<IInputs>): React.ReactElement {
//Local variables let isDisable: boolean = false; let isMultiple: boolean = false; let dropDownProps: any; //Calling function to get the attributes this.GetEntityAttribute(context); //Calling function to get the selected values this.selectedItem = this.getSelecetdItems(context) dropDownProps = { entityMetadata: this.entityAttributes, defaultSelectedOptions: this.selectedItem, isMultiple: isMultiple, isDisable: isDisable, notifyChange: this.notifyChange.bind(this), context: context }; return React.createElement( DynamicDropdown, dropDownProps ); }
Field Interface then:
It happens because when an async function is called and executed the program control directly jumps to the next line of the updateView() and executes it first and renders a dropdown control with no options. It then goes again to the async function to execute the code after await where we had our array of all attributes. Since the control was rendered already, we will not get a drop-down with options.
To solve this issue we will use the useEffect() function of the react and call async functions inside it rather than calling the async function in the updateView(). Thus, the updateView() will now look as follows.
UpdateView() Now:
public updateView(context: ComponentFramework.Context<IInputs>): React.ReactElement { //Local variables let isDisable: boolean = false; let isMultiple: boolean = false; let dropDownProps: IDynamicDropdownProps = {}; let entityName: string | null = ""; entityName = context.parameters.entityName.raw ? context.parameters.entityName.raw : context.parameters.fieldName.raw; //Reading the parameters dropDownProps = { isDisable: isDisable, isMultiple: isMultiple, entityName: entityName, context: context, notifyChange: this.notifyOnSelect.bind(this) } return React.createElement( DynamicDropdown, dropDownProps ); }
We will create a Helper.ts file containing the functions and then create the object of the class containing all the functions in App.tsx file which consists of a functional component. We have also passed a dependency to ensure that the useEffect() gets called every time there’s a change in the entity name.
Helper.ts
public GetEntityAttribute = async (entityName: any) => { //Local variables let functionName: string = "GetEntityAttribute()=>"; let res: any; let attributesLogicalname: any = []; let result: any; let entityAttributes: any = []; try { if (!this.isValid(entityName)) { return { options: entityAttributes } } //Making request for entity metadata to get logical names of the attributes res = await this._context.utils.getEntityMetadata(entityName); //Getting all logical name of the attributes and storing it in the array attributesLogicalname = res._entityDescriptor.AttributeNames; //Making request to get logical name as well as display name of the attributes result = await this._context.utils.getEntityMetadata(entityName, attributesLogicalname); //Converting the object keys to an array for iteration let response = Object.keys(result.Attributes._collection); //Pushing the attributes into the array for (let j = 0; j < response.length; j++) { if (result.Attributes._collection[response[j]].DisplayName != null) { entityAttributes.push({ key: result.Attributes._collection[response[j]].LogicalName, text: result.Attributes._collection[response[j]].DisplayName }) } } entityAttributes.sort(function (a: any, b: any) { if (a.text < b.text) { return -1 } if (a.text > b.text) { return 1 } return 0; }); } catch (error: any) { //Handling error this._context.navigation.openErrorDialog({ message: functionName + ": Kindly check the entity name and it must be in lowercase" }) } return { options: entityAttributes } } App.tsx: useEffect(() => { _CrmHelper.GetEntityAttribute(props.entityName).then((success) => { //Setting the dropdown options setDropDownOptions(success.options) }); }, [props.entityName])
Field Interface Now:
Thus, we saw how to use Async-await on a load of virtual PCF control.
Please visit the Source and support them
The post Use of async-await in virtual PCF control appeared first on Microsoft Dynamics 365 Blog.
]]>The post How to configure Power Apps assets within Power Apps appeared first on Microsoft Dynamics 365 Blog.
]]>As the name suggests, Advisors let you configure experts in your organizations so that the users can contact them if they are stuck anywhere. As of now, there is no known limitation on the number of advisors that you can configure. Since this feature is still in the preview stage, it is not recommended to use it in production.
To configure the Advisors, we have to add the following –
To configure the Power Apps assets (Internal Resource Links & Advisors), follow the below steps –
1. Log in to the Power Platform using the admin account.
2. Expand the Resources tab on the left-hand side and click on Power Apps assets.
3. A window will open where we can insert Internal Resources Links. Here, we can configure 3 types of links –
a. Documentation –
If you’ve any internal documentation maintained which is hosted on a central location, you can insert the URL of the same.
b. Teams Group –
If you have an internal Microsoft Teams group, you can provide the URL of the same.
c. Yammer Community –
If you have a Yammer Community for your organization, you can provide the URL of the same.
After the available links are provided, click on the Save button.
4. Now, click on the Advisors tab. Here we can configure all the available advisors in your organizations. You can select from all the users that are present in your organization.
5. Click on Add an advisor.
6. Select the desired user and click on Add.
7. Once all the advisors are added, they will look like the one below. In the status column, they will be shown as available or unavailable.
8. The status will remain unavailable until the advisor logs in to his/her account and opts into the advisor program.
9. Once the user is added as an advisor, he/she has to follow the below steps to be shown as an advisor –
a. Log in to the Power Apps Portal.
b. They will be asked if they want to opt-in to the organization’s Power Apps advisor program.
c. Click on Yes, I’ll help. Another pop-up will be opened with which they can configure if they want to opt-in and if yes, should be emailed or contacted using teams. Select the appropriate option & click on Save.
d. Once they set their availability to Available, their status will be changed to Available from Unavailable.
10. Now whenever the Virtual Agent is unable to answer a user’s query, the internal resources link & Advisors will be shown as shown in the below GIF.
This is how we can configure the Power Apps assets and bring in the help of actual people along with the virtual agent, thereby easing out on workload.
Go to Source and hit them a thumps up
The post How to configure Power Apps assets within Power Apps appeared first on Microsoft Dynamics 365 Blog.
]]>The post Use of isPropertyLoading property in PCF Control appeared first on Microsoft Dynamics 365 Blog.
]]>Let’s have a look at the issue first. As seen in the below screenshot, I have added our PCF control on the First Name field. Kindly refer to this blog to have a look at it as well. Here you can see that the contact does have a first name, but isn’t being rendered in our control.
This happens, because as per my observation the PCF controls end up loading first before the full form is loaded which causes an issue while loading the default values. So to overcome this, I will use a property that is passed through context known as isPropertyLoading.
As per my observation, isPropertyLoading will return true until the form is completely loaded and the context can get actual field values instead of null.
So I will add a conditional rendering based on the isPropertyLoading property. Where I will render our component only when isPropertyLoading is false. Below is how I will implement this –
/** * It is called when some value in the property bag has been changed. This includes field values, data sets, global values such as the container height and width, offline status, and control metadata values such as label, visible, and more. * @param context The entire property bag is available to control via Context Object; It contains values as set up by the customizer mapped to names defined in the manifest, as well as utility functions * @returns ReactElement root react element for the control */ public updateView(context: ComponentFramework.Context<IInputs>): React.ReactElement { //@ts-ignore let isPropertyLoading:boolean = context.parameters.textField.isPropertyLoading; if(!isPropertyLoading){ const props: IStringChekerProps = { defaultValue: context.parameters.textField.raw!, onInputChanged: (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string | undefined) => { this.currentFieldValue = newValue!; this.isValidString = this.validateStringField(this.currentFieldValue); this.notifyOutputChanged(); } } return React.createElement( StringCheker, props ); } else { return React.createElement("div"); } }
What I’ve done is we are returning the empty element by return React.createElement(“div”); when isPropertyLoading is true and return the actual component only when the isPropertyLoading is false. After this change, the control will load normally like the below –
Conclusion – This is how we can use isPropertyLoading to prevent displaying empty PCF values even though data exists.
Go to Source and hit them a thumps up
The post Use of isPropertyLoading property in PCF Control appeared first on Microsoft Dynamics 365 Blog.
]]>The post New Mobile “Offline-First” Setup within PowerApps appeared first on Microsoft Dynamics 365 Blog.
]]>After enabling the app for offline use, the following pop-up gets displayed on the screen.
The user is prompted to download the offline data as shown in the following screenshot. However, users also have an option to skip downloading data due to which the offline experience was not satisfactory.
Now Dynamics 365 has introduced a new setting called “offline first mode” with the help of which the user will no longer get the option to skip downloading data for offline use. Instead, now the data will be downloaded automatically in the background.
The offline data will now be automatically synced in the background hence the data will always be the same, regardless of the network connection.
The offline-first setting is an app-based setting. It could be enabled using the following steps:
1. Sign in to power apps
2. Select Apps from the left pane
3. Select the desired model-driven app that you want to enable offline and select Edit to open the modern app designer for the same
4. On the command bar, select Settings
5. On the Upcoming tab, set the “Choose the offline mode to apply to your app” toggle to No.
6. Select Save and then Publish the app.
Note: Some features are only available when the user is online such as dashboards, charts, multiple-table business process flows, and server-side sync.
Initial offline sync
For the app to be available in offline mode, app and user data must be downloaded on the device. This process is popularly named the “initial offline sync”.
The app data has all the resources needed for the proper running of the app. User data includes what is configured for the offline profile and stored in Microsoft Data-verse tables.
With offline-first, during the initial offline sync, user data will be saved in the background
This takes some time, based on details configured in the offline profile.
Incomplete initial offline sync gets triggered with every app opening.
Users will also get the same notification when they resume the app after a long period of inactivity.
Users can also select the Offline status button to see more information about sync progress.
When the user refreshes their data on a grid view, they will get a notification stating, Refreshing your data.
When the initial sync is complete, the user can start using the app in offline mode. The App will be available to select in offline mode. After selecting the app the user can select the table which has been added to the mobile offline profile.
Now the user can make changes while in offline mode and they will be synced when the network is restored.
With the introduction of the “offline first mode” setting, users can no longer skip the offline data background saving. The offline data will now be stored automatically in the background making the data available even while in the offline mode so the data will always be the same, regardless of the network connection.
Ps: Our favorite Community Summit is back trending with #MySummitNA – Eagerly awaiting to meet our CRM friends in person. Inogic will be at Booth #1334 at the Summit, Gaylord Palms, Orlando, FL from 10th to 13th October 2022. Do block your calendars for 12.15 pm on Oct 12th for our Partner Solution Showcase session Maps for CRM – Maplytics by our CEO at Room Coastal 7 – Convention Center, Level 2. Register now using our Promo Code INOGIC10, and avail of 10% off on your registration!
Please visit the Source and support them
The post New Mobile “Offline-First” Setup within PowerApps appeared first on Microsoft Dynamics 365 Blog.
]]>The post Format input values into different user input formats using Formatting API in PCF Control appeared first on Microsoft Dynamics 365 Blog.
]]>In the previous blog, we have explained the Formatting API of PCF Control where we used the Formatting API to format the input values.
Earlier, we used different Formatting API methods to format the number and date values. In this blog, we will introduce a new Formatting API method (formatUserInput) that formats the given input values in different user input formats.
In the below example, we have set the user settings as Number with 2 precision:
Given below are the two (Decimal Number) examples, where in the first example, the input value format to the user format is defined in user settings of Dynamics 365 CRM. And in the second example, the input value format to the user input format is passed as a input parameter to Formatting API method (formatUserInput).
//Function that return result in user decimal format from input value formatToDecimal(context: ComponentFramework.Context<IInputs>, inputValue:any) { return context.formatting.formatDecimal(inputValue); } //Function that return result in decimal format that passed in user input type formatToInputType(context: ComponentFramework.Context<IInputs>, inputValue:any): any { let userInputType = { Type: "decimal", Precision: 4, PrecisionSource: 0, Behavior: null, OptionSet: null, Format: null }; return context.formatting.formatUserInput(inputValue, userInputType); }
In the below screenshot, you will find here that we have run the debugger to see the result of the format of input values:
With the help of Formatting API of Power Apps, we can easily format the input values to different user input format.
Go to Source and hit them a thumps up
The post Format input values into different user input formats using Formatting API in PCF Control appeared first on Microsoft Dynamics 365 Blog.
]]>The post Format date-time value using Formatting API in PCF Control appeared first on Microsoft Dynamics 365 Blog.
]]>In our recent project, we created a PCF Control in which we designed a date-time control. In the same control, we had a requirement to format the input date value to the given Date/Time field behavior in the date/time field of Dynamics 365 CRM. In Dynamics 365 CRM, date/time field have three types of behavior such as User Local, Date Only, Time-Zone Independent as shown in the below screenshot:
To achieve this, we have used the formatTime method of formatting API in Power Apps. With this method, you can format the date/time values in dateTime field behavior.
Please find below the code to format the input date/time values in PCF Control:
//Function that return result in datetime format from input date value formatToTime (context: ComponentFramework.Context<IInputs>, inputDateValue:any) { return context.formatting.formatTime(inputDateValue, 0); } //Function that return result in datetime format from input date value formatToTime (context: ComponentFramework.Context<IInputs>, inputDateValue:any){ return context.formatting.formatTime(inputDateValue, 1); }
After running the debugger, the result of formatting input date/time values to dateTime format will be as below:
With the help of Formatting API in Power Apps, we can easily format the input date values to the dateTime behavior format.
Go to Source and hit them a thumps up
The post Format date-time value using Formatting API in PCF Control appeared first on Microsoft Dynamics 365 Blog.
]]>