Posts

Showing posts from September, 2020

Exception handling in Power Automate Flows

Image
Out of other errors type one is logical errors. There are many reasons for this type of errors, for example, unexpected user input etc. In most of computer languages we handle these error by exception handling or try-catch blocks. However, in Power Automate we also have this feature available to handle exceptions well in the flow and keep the flow running to complete rest of the flow logic. There are two ways to implement exception handling in Power Automate Flows.  Use Power Automate template (https://emea.flow.microsoft.com/en-us/galleries/public/templates/e8e028c6df7b4eb786abdf510e4f1da3/try-catch-and-finally-template/) Using 'Scope' action with 'Configure Run After'  property Let's dig into each block in the template Try - Contain all the actions coming from main flow Catch - This control configured to run once "Try" block is failed Finally - This block must run, no matter what is the output of previous block Now lets configure Try-Catch blocks within

Get Lookup / Power Automate text value instead of guid / integer values using Power Automate

Image
Problem Statement In Power Automate flows, I was getting GUID for lookup and integer for optionset fields instead of text values for both fields.  Example For a contact records below from CRM, I've Account Name as lookup field and Preferred Method of Contact an optionset field. Solution To get face values for lookup as well as for optionset, you need to use below expressions body('SourceDataSet')?['<FieldName>@OData.Community.Display.V1.FormattedValue'] SourceDataSet - the dataset from where you are trying to get face values for optionset and lookup Field Name - logical field name;  In our case, source data set is "GetContact" while below are fields Preferred Method of Contact - preferredcontactmethodcode Account Name (lookup field) - _parentcustomerid_value So as par above expression, let complete our expression and put in Power Automate Flows Compose component. For Optionset,  body('GetContact')?['preferredcontactmethodcode@OData.Commun