Posts

Showing posts from October, 2022

How to send dynamic attachments in a email using Power Automate

Image
 We can send documents get from SharePoint or other sources and send as attachments in email. In my case, I need to get the SharePoint document based on the id and convert to PDF. Once we convert to PDF, need to send the PDF document as attachment in a email. To get the SharePoint document, I have used Get File Content method to get the file content. Once we get the content, Using One drive convert method, convert the file to PDF. (before conversion, we need to create same file in One drive using Create File Method). Once we get the file content, we can send the file as attachment in the attachment section as sown below. We can also pass the JSON instead of passing the attachments. We can use this option if we have the array configured already. 

Convert HTML to Text in Power Automate

Image
We got a requirement from the customer to automate the server status details. There ill daily email alert trigger from server to Shared email box. We have created a flow based on the email alert triggered to Shared mail box as below Based on the Subject, Trigger will identify the email. In the trigger condition we have mentioned not to trigger if the Subject contains RE or FW. Once we get the email to extract the content, using HTML to Text conversion action. In HTML to Text conversion email text will convert to string. Once we get the string i am using the string options to extract the required text and converting the string to JSONformat by applying the loops.

Concurency Control and Degree of Parallelism in PowerAutomate

Image
Concurrency control and Degree of parallelism are the options available in Power Automate triggers and Apply-each controls. Using Concurrency Control option, We can control number of flows to run in parallel. Without enabling the concurrency control, power automate can trigger multiple instances of a flow. But enabling the concurrency control we can mention number of instances to trigger and run in parallel. If we trigger multiple flows they will be in waiting stage. To enable PowerApps Concurrency control, select Settings and click on Concurrency control as below. After enabling the Concurrency control, there will be Degree of Parallelism option. This will allow how many flows to trigger at parallel.  In the above case, only 25 instances can run in parallel. If we get more than 25 instances they will be waiting status as below. Similarly we can enable Concurrency Control for Apply-each and it will run parallelly. 

Active Screen in PowerApps Canvas App

Image
 PowerApps Canvas app will have App property will have different properties. ActiveScreen is one of the property in PowerApps App level. ActiveScreen property will following properties, Name ContentLanguage Orientation BackgroundImage Fill Height ImagePosition LoadingSpinner LoadingSpinnerColor Printing Size Width We can set the screen color based on the ActiveScreen name. We can change the field types based on the current screen. We can set the Screen background using the formulae below. If(App.ActiveScreen.Name = "Screen1",Gray,Tan)

Update look-up column types in Data verse using flow

Image
In Data verse power automate, we don't have direct option by passing the value to the field. We need to pass the Table with Id of the column. For Instance i have Table A and I am trying to update the Lookup column in Table  B, we need to pass the id of the Table A column. For Example we have Loans Table and referring loans table inside of the other table as a lookup column. to Update the Lookup column, we need to pass the value of the Loans as shown the image below. Similarly we can update the other columns like Owners based on the System Users as shown below.  

Custom Links in Approval flows

Image
 We can add custom links in the approval flows using the formulae. We can add the links using following formula in the approval email. [Go to Link](http link) Here are the steps i have used to send the email with the link. I have added the Approval mail and in the Description i have added the link as below. We can see the email in the output as below. Similarly, we can add dynamic links to the approval flow by using compose action and adding it as output to the approval link.

Clear option for PowerApps Text Box

Image
 PowerApps allowed to clear the Text Box value while entering/Selecting the Text Box value. For Text Box We have Property "Clear" for the Text Box. Clear Property can be applied through left top Clear option or Right Properties pane as shown below. By updating Clear button option we can see the "Cross" icon as shown below.

Update file name is a SharePoint document library folder

Image
One of my projects, i got a requirement to change the file names in SharePoint document library folder. We can update the document name using the steps below. Get SharePoint files in a folder using the Fet SharePoint files action below, On each file update the file name using Send HTTP action with following details. Site Address : <<Site Address>> Method : Post Uri: _api/lists/GetByTitle(' <<Document Library Name>> ')/Items( <<ITEM ID>> ) Headers: Content-type: application/json IF-MATCH: * X-HTTP-METHOD: PATCH Body: {'__metadata': {'type':' <<SharePoint Document type>> '}, 'FileLeafRef':' <<File Name to be Updated>> '} We can get the type of the document in the body, (for me it is  SP.Data.Shared_x0020_DocumentsItem) by accessing the api URL and check for the "term" in the url as below.

Flow - Determine the event type in Data verse table

Image
Using CDS connector we can trigger the flow based a event trigger in the Data verse table. Based on the determine the event fired in a data verse we can determine the actions to be performed in the data verse. While creating the table, we can choose the Change type as below.   To determine the type of the event, there is a property in called SdkMessage. We can get the property values using the expression. We can get the values from SdkMessage as “Create”, “Update” as below.   We can get the SdkMessage using the expression below. Based on the type of the event, we can determine the actions .