Skip to main content

Posts

Showing posts with the label flow

Make your flows configurable using environment variables

Environment variables Flows often require different configuration across your environments and this is where environment variables come handy. Environment variables allow you to store different configuration variables in each of your environments or to fallback to a default value. I just recently used them to define the "sender" (name of a queue) of a notification e-mail in a flow. Define environment variables You can add a new environment variable via the new maker studio (make.powerapps.com), by opening one of your solutions and click on New -> Environment variable: After having defined your default and environment specific value it should look like that: Using environment variables in a flow To retrieve the value of an environment variable, we add a list records action, where we search for the environment variable by schema name and expand the query with the environment specific value (stored in a linked entity): Finally we initialize a variable, where we either set the...

Power Automate Get absolute Sharepoint URL from document location

Document Locations If you enable Sharepoint document integration in your model driven apps, you can define for which entities the possibility to upload documents to sharepoint shall be offered and you can define a folder structure. Possible folder structures can either be based on account or contact, which means if you create child items (e.g. opportunities, activities, ...) sub folders are created below. If an entity is enabled for document management a "Files" tab is added to the form of your model driven app and as soon as you click on that tab a folder is automatically generated on Sharepoint. Once the folder has been created you have options to create new or upload existing file or to open the document location (folder) on Sharepoint: What happens behind the scenes is, as soon as you click on the files tab your model driven app checks, weither a "document location" for this item already exists, or not. The document location is an own entity in C...

Substrings in Power Automate

Substrings Today we will look at an example, how to extract a substring from a given string. Our aim is to extract the file extension of a note (attachment in CDS) from the mime/type field. Single vs. multiple records First we fetch our underlying note using either the get record or the list records CDS action: Depending on the action you choose, the formulas below differ, since "Get record" returns just one single record, while "List records" can return multiple records. For a single record you will reference your fields like outputs('<Name of your action>')?['body/<'name of your field'>']. While for multiple records you will have to put your actions into an apply to each "group" and will reference your fields like items('<name of your apply to each action>')?['<fieldname>']. Extract substring Once we have added an action to fetch our underlying record: we are ready to ...

Power Automate - On-premises data gateway

On-premises data sources In this blog post we will have a look, how to integrate Power Automate with an on-premise SQL server. For this purpose I locally installed Microsoft SQL Server and installed the Adventure Works sample database. Additionally I added a new SQL server login, with read/write permissions for the Adventure Works database. (In integration scenarios, you most probably restrict this service user to some views or stagging tables, required for your integration). Azure on-premises data gateway To be able to integrate with your on-premise database, you need to install the azure on-premises data gateway on your SQL server. When you start the setup, you can choose between two types of setup. We will choose the type of setup that supports Power BI, Power Apps and Power Automate: Then you follow the installation procedure and at a certain point you will be asked for the e-mail address of the user that shall be used for the integration. Here you shou...

Working with email attachments in Power Automate

CDS connector There are many blogs explaining how to fetch email attachments from CRM and uploading them to Sharepoint using the old Dynamics 365 connector. But since this connector has been announced as deprecated in April 2019, I tried to achieve the same using the Common Data Service connector. My use case is to upload e-mail attachments to sharepoint, in case an e-mail contains attachments and it is linked to an opportunity. So first we define the following trigger: Then we add a condition to check, weither the e-mail is linked to an opportunity: As a next step we query all attachments related to this e-mail, but wait there are two entities called "attachment" offered: So let's try the first one: And what we get back is some metadata about the attachment, but not the filename and the body of the attachment, we are looking for: But at least we are a step closer to our attachments. Lets try the second "attachment...