Featured

A PowerAddict PowerPlatform Gift 4 you

 

When I started my powerplatform journey, I was missing an environment where I could test and develop. In the beginning I used the default solution from my employer and since I was the only one in the whole organization using powerplatform in 2018/2019, this worked out fine. But one day I wanted to use everything not only for business but also for my private life and of course I was missing the right domain / platform. In the meantime I use the powerplatform developer plan from #microsoft because it allows me to try, test and use things independent of my employer (who might change someday). I would like to give you this opportunity as well, because I know how you feel without such a platform.

Here (new.thepoweraddicts.com) you can create your own private powerplatform account and start your own development environment after a few moments. Important: the entire thing is free for you and unlimited (usable within the development plan).

Featured

Return an array from a PowerAutomate to PowerApps (Split Method without Premium)

http://www.clipartbest.com/clipart-eTMA65Lrc

Basically, there are already some posts and videos on this topic. However, I would like to point out a great post incl. app for generating the function. (by Brian Dang)

You can find the complete tutorial under this link:
https://powerapps.microsoft.com/en-us/blog/return-an-array-from-a-sql-stored-procedure-to-powerapps-split-method/

Below you will find a shortened version.
As already written, Brian Dang has not only provided a detailed tutorial for us in the linked post but also a downloadable PowerApp to generate the code.

Download the App: https://aka.ms/splitarray

Preparation in the flow (PowerAutomate)

Parsing the Array in PowerApps

Following text copied from: https://powerapps.microsoft.com/en-us/blog/return-an-array-from-a-sql-stored-procedure-to-powerapps-split-method/

Open an existing app or create a blank one to test out your flow.

As mentioned before, you can download an app for generating a formula that can split the text string from Flow back into an array.

  • Open another instance of the Power Apps Studio.
  • Click File, then Open.
  • Browse for the msapp file that you downloaded.

When the app opens, fill out the text boxes with details for your app:

  • Name of your flow: include single quotes if your flow’s name would require them.
  • Name of text field returned from flow: the name of the field you chose in the last step of your flow.
  • Name of variable for flow response: the name of a variable that will be receiving the string from the flow.
  • Name of collection for records: the name of the collection that will be the array you use throughout the app
  • Delimiter from join: the delimiter you chose for the Join step in your flow.

Click ‘+ New column’ to add the column names in your app. Use the drop down menu beside each column to determine its type. This tool is limited to only strings, numbers, and Boolean values.

Featured

The Big 5 (Variables / Parameters) in PowerApps

Photo by Ann H on Pexels.com

If you create a PowerApp and look around on the internet for solutions, you will come across the following functions from time to time.

  1. set()
  2. updateContext({})
  3. with()
  4. navigate(…,…,PARAMETER)
  5. param()

In the following I will show you briefly what I use them for and why you should think about using them too.


  1. set() function
    This is probably the best known function of all. It sets the value of a global variable. Global variables are useful when you want to store a value and use it on different screens. This can be used in the OnStart, where you set style variables, the logged in user or if you select an element from a gallery and want to use this element somewhere else.

Set(
varUser,
user()
)


  1. updateContext({})
    This is the little brother of the Set function. Sets the value of one or more context variables of the current screen. I mainly use this when I want to change a value (true,false) to show/hide something for example. Mostly a pop-up or another input window.

    Here I set the variable “locPopUp” first to “true” and then again to “false”.

UpdateContext({locPopUp: true});
UpdateContext({locPopUp: false})


  1. with({})-function
    This function I discovered some time ago and is again the little brother of UpdateContext. Here “variables” are stored exclusively for a function and can only be referenced in this function. I use this mainly within functions, as soon as I have to use a certain function several times.

    In this example I write the variable “locText”, to which I then reference 2x in the further course of the function. Important: the With function is closed only at the end of all functions.

With(
{locText: TextInput1.Text},
If(
IsBlank(locText),
“noText,
TextInput1.Text
)
)


  1. navigate(…,…,{PARAMETER})
    This parameter was unknown to me for a long time, because I usually stopped after the first comma and closed the parenthesis. But if you put two more commas after the Navigate, you can pass one or more parameters to the screen you want to navigate by using the curly braces. This parameter is then only available on the following screen. (unless you write it into another variable or pass this value again)

    In this example I pass to Screen1 the parameter “locVariableNextScreen” with the text “Yes we can use it”.

Navigate(
Screen1,
UnCover,
{locVariableNextScreen: “Yes we can use it”}
)


  1. param()
    This provides access to parameters passed to the app when the user has it open. This parameter is usually used less often, as this is exclusively appended to the app’s URL. Thus it is possible to navigate the user to a certain page or to pass certain values to the app.

    Here I pass the parameter “Admin” with the value “true” in the URL. In OnStart I then set the global variable “varAdmin” with the parameter “true”. So I can enable additional settings for an admin, using this parameter. (Visible: varAdmin)

https://apps.powerapps.com/play/543654354453543543?tenantId=dasfdgdsgsfsdfsdf&Admin=true

Set(varAdmin,Param(“Admin“))


Extra tip: If you use a variable and want to use it as a boolean, which is always the opposite of the current state, use the “!” in front of the variable. This reverses the value.

This example reverses the value every time it is executed. If is currently true, it will be changed to false and vice versa.

UpdateContext({locPopUp: !locPopUp})

Featured

Power Apps change the app owner with PowerAutomate

In the post of 2020-12-09 I showed the video of Shane Young, where it is shown how to change the AppOwner using PowerShell. However, there is another, perhaps even easier way to change the AppOwner. Using PowerAutomate.

Why should I change the owner of the app, which is the creator? One of the reasons that comes to mind is that the person has left the company, or you want to transfer all apps to one account.

Here is the short tutorial on how to change the AppOwner of PowerApps using PowerAutomate.

Here you can see the simple structure of a flow, which is triggered manually.

Next, the new AppOwner is searched for in the action “Search for user”. Make sure that this is unique and that only one user is found.

Then use the action “Set App Owner” and fill in the fields. Under Environment Name you can get the ID from the URL above. (2. on the picture below) The same applies to the PowerApp name. Just insert the App ID here. (1. on the picture below)

Finally insert the ID that comes from the action “Seach for user” and the AppOwner will be changed. (if you have the permissions)

 

Everything you need to build a Model-driven Power App from Shane Young

This is a great video to get started with the world of ModelDriven apps. Just like Shane, I started with canvas apps and discovered ModelDriven apps for myself some time ago.

I find DataVerse4Teams and PowerApps4Teams in particular very exciting.

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

Trigger a flow only once without premium? Yes, you can lock a flow temporarily.

Photo by Karolina Grabowska on Pexels.com

Examples
Overview Total Flow
Preparation
Structure of the flow
Flow-Code to copy

Maybe the title seems a bit strange to you, but I would like to show you how to trigger a flow only once every X minutes.

There is a function ‘Concurrency Control’ which ensures that the flow can be executed in parallel only X times (here on the picture I have set 1 time).

The disadvantage of this setting is that if i still try to start the flow, all flow runs will be queued and executed one after the other.

In my example i show you how the flow is only executed completely every X minutes (depending on the setting) and does not perform your actions in the meantime.

I tested this variant with a ‘PowerAutomate Free’ user to make sure that the DataVerse connecton used here in the solution is really usable without Premium.

Thanks also to Ludovic Perrichon and his blog post ‘Set Environment Variables with PowerAutomate‘ where I was able to get some tips.

Examples to use

  1. You want to start a DataFlow to synchronize data from powerapps only every certain interval and when it is needed..
  2. You want to send error mails only once and not every time the error occurs.
  3. You want to update the DataSet of PowerBI only every certain interval and when it is needed. (e.g. Trigger via Mail or PowerApps)

Overview Total Flow

Preparation

First create an environment variable. We will use this later during a flow-run to ‘Check-In’ (in our case 1), if this is the only active flow. At the end of a flow-run this flow will be set back to the status ‘Check-Out’ (in our case 0).

Structure of the flow

  1. Enter the InternalName (incl. prefix)
  2. In the condition we check if a flow has already set the environment variable to status ‘Check-In’ (here 1).
  3. Here we refer to the environment variable we inserted under 1. and retrieve it in the corresponding dataverse table.

    Then we write the value 1 into it (here our ‘check-in’)

  4. Under YOUR FLOW RUN you can add your own actions. So build your own flow as usual.
  5. In the last step we set again the environment variable to 0 (‘Check-Out’)











Flow-Code to copy

{"id":"6a710bec-59b5-41e2-9d66-522828bc1a1d","brandColor":"#8C3900","connectionReferences":{"shared_commondataserviceforapps_1":{"connection":{"id":"/new_crDataVerse"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Trigger_a_flow_only_once","operationDefinition":{"type":"Scope","actions":{"Initalitation":{"type":"Scope","actions":{"EnvironmentVariable_InternalName":{"type":"Compose","inputs":"new_evCurrentFlowRun","runAfter":{},"metadata":{"operationMetadataId":"e7863b68-180c-4a90-9ce8-c10dcefa3243"}},"Next_time_run_in_..._minutes":{"type":"Compose","inputs":1,"runAfter":{"EnvironmentVariable_InternalName":["Succeeded"]},"metadata":{"operationMetadataId":"226a23bb-1135-4353-9665-356b57fc74a9"}}},"runAfter":{},"metadata":{"operationMetadataId":"69ee8a97-af1f-4a67-8fd5-a7e599085717"}},"Condition":{"type":"If","expression":{"equals":["@parameters('ev CurrentFlowRun (new_evCurrentFlowRun)')","@string('0')"]},"actions":{"CheckIn_EnvironmentVariable":{"type":"Scope","actions":{"List_rows":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps_1","operationId":"ListRecords","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"environmentvariabledefinitions","$filter":"schemaname eq '@{outputs('EnvironmentVariable_InternalName')}'"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"03ece656-fbd2-4b03-8108-a3e410ca8af6"}},"Update_a_row":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps_1","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"environmentvariabledefinitions","recordId":"@first(outputs('List_rows')?['body/value'])?['environmentvariabledefinitionid']","item/defaultvalue":"1"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"List_rows":["Succeeded"]},"metadata":{"operationMetadataId":"bafd5564-fcc7-4dd5-8db9-24770f9abd12"}}},"runAfter":{},"metadata":{"operationMetadataId":"0e6a1572-f9aa-460c-8bc0-62d2b211d7a4"}},"YOUR_FLOW_RUN":{"type":"Scope","actions":{},"runAfter":{"CheckIn_EnvironmentVariable":["Succeeded"]},"metadata":{"operationMetadataId":"07812991-d984-4cd2-963a-6cf3c33a2760"}},"CheckOut_EnvironmentVariable":{"type":"Scope","actions":{"Delay_to_reset_EnvironmentVariable":{"type":"Wait","inputs":{"interval":{"count":"@outputs('Next_time_run_in_..._minutes')","unit":"Minute"}},"runAfter":{},"metadata":{"operationMetadataId":"433a9fec-2212-4a2e-a662-6ee05709d41d"}},"Update_a_row_2":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps_1","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"environmentvariabledefinitions","recordId":"@first(outputs('List_rows')?['body/value'])?['environmentvariabledefinitionid']","item/defaultvalue":"0"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Delay_to_reset_EnvironmentVariable":["Succeeded"]},"metadata":{"operationMetadataId":"cda37d9a-9b1c-4565-b8a2-47086da28702"}}},"runAfter":{"YOUR_FLOW_RUN":["Succeeded","Failed","TimedOut"]},"metadata":{"operationMetadataId":"67d1627a-e2b3-4d8e-9d65-994809442d32"}}},"runAfter":{"Initalitation":["Succeeded"]},"metadata":{"operationMetadataId":"1f9b31db-6d78-46ab-af7f-7b004a375f62"}}},"runAfter":{},"metadata":{"operationMetadataId":"1b5d9a0a-3223-45df-b9d3-afe6eedf8a3b"}}}

New Power Automate New Expressions – Sort Functionality and more! from Paulie M

Great demo of the new features ‘is…’, ‘sort’, ‘reverse’, ‘chunk’

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

Create Documents from Power Apps using Power Automate #PowerAutomate #PowerApps from Damien Bird

This is a great summary of the possibilities to have a file with content (here an invoice) dynamically created. Damien shows here in addition to the HTML also Excel Script and Word Template.

Sometimes the exciting things are in the detail.

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

Power Automate Error History in a Microsoft List with Email / Teams Alerts from Damien Bird

Great overview of the Try-Catch method and how to read and save the data in catch.

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

Exporting and importing Microsoft Dataverse for Teams solutions from Tomasz Poszytek

Compilation of which ways of export and import there are. in addition, valuable information from when you need dataverse licenses and what is stored where during import.

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

Power Automate JSON Arrays and Objects Techniques from Damien Bird

Damien shows here how to implement some UseCases and data manipulation using PowerAutomate.

e.g. Add an additional column to a table using AddProperty || xpath(xml) to get sums, minumum and maximum value || count how many values are available

Important to remember is the last step – how to find out which values are present (or not present) in another table. with it you can easily filter out new items.

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

Power Automate Compose, Join, Select, Filter, Create tables, Parse JSON | Data Operations in flow from Reza Dorrani

Here you can not only see how all data operations work, but Reza also shows how you can dynamically create tables for emails. (here as an example approval responses)

I always find it fascinating what you can do with the standrt Data Operation and use some tricks from Reza (from another video) as well.

You can see this video here on my blog because I have rated this video with 5 stars in my Youtube video library. This video was automatically posted using PowerAutomate.

How to restore (and create) a backup from a flow

Photo by Sergei Starostin on Pexels.com

I think this is the most frequently asked question.

Unfortunately, there is no simple standard solution, but I will show you some possibilities how to avoid this problem in the future. My inspiration for this Solution was Audrie Gordon and Pieter Veenstra. The code for the flows (copy & paste) is at the end of this article.

  1. How do I restore an earlier version of my flow (Power Automate) from John Liu
    The first and easiest solution is the one I presented in this blogpost. It is not free, but it does exactly what we want it to do.
  2. Backup and restore using solution and power automate ⑴
    For this, we create a ‘backup’ solution where we add the specific flow (we could also backup multiple flows over it at the same time). It is important to say that the dataverse actions are NOT premium, and you can use them.

    It is possible to have one flow in multiple solutions. This is what we use here. Significant to know is that in the end it is only one flow that is linked multiple times. i.e. if we change or restore it, it is changed in all locations.

    In this solution, I have the flow saved with the solution as a ZIP-file on the OneDrive for business, but of course any location is possible.

    Backup:
    – Build your flow like above
    – SolutionName = Name-Column in the solution (no spaces)
    – File Content =
    base64ToBinary(outputs(‘Perform_an_unbound_action’)?[‘body/ExportSolutionFile’])

    ExportSolution
    Restore:
    – Choose file on your data storage (here OneDrive for Business)
    – take the file content “$content” to the CustomizationFile
    ImportSolution
  3. Backup and restore using just power automate ⑵
    Even if this solution looks the most complicated at first sight, I prefer this variant. Here we can either use a child flow or copy this directly into our flow.

    I would only use this in the development/customization phase so that a backup is created at the end of a successful flow run. This way we always have a backup of the last successful flow.

    In this solution, I have the flow saved as a JSON-file on the OneDrive for business, but of course any location is possible.

    Backup:
    ExportFlow

    Restore:
    ImportFlow

⑴ Backup Solution

{"id":"d6ad0518-4a44-45dd-8c0e-08125d42e8d5","brandColor":"#8C3900","connectionReferences":{"shared_commondataserviceforapps":{"connection":{"id":"/crce7_sharedcommondataserviceforapps_6ab0c"}},"shared_onedriveforbusiness":{"connection":{"id":"/new_sharedonedriveforbusiness_58eca"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Restore_Solution_from_Backup","operationDefinition":{"type":"Scope","actions":{"Restore_Solution":{"type":"Scope","actions":{"Create_file":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_onedriveforbusiness","operationId":"CreateFile","apiId":"/providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness"},"parameters":{"folderPath":"/Backup PowerAutomate","name":"@{outputs('Internal_Name_Solution')}_@{utcNow()}.zip","body":"@base64ToBinary(outputs('Perform_an_unbound_action')?['body/ExportSolutionFile'])"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Perform_an_unbound_action":["Succeeded"]},"runtimeConfiguration":{"contentTransfer":{"transferMode":"Chunked"}},"metadata":{"operationMetadataId":"00315691-0b73-4f68-bee9-23c81d12826d"}},"Perform_an_unbound_action":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"PerformUnboundAction","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"actionName":"ExportSolution","item/SolutionName":"@outputs('Internal_Name_Solution')","item/Managed":false,"item/ExportAutoNumberingSettings":false,"item/ExportCalendarSettings":false,"item/ExportCustomizationSettings":false,"item/ExportEmailTrackingSettings":false,"item/ExportGeneralSettings":false,"item/ExportMarketingSettings":false,"item/ExportOutlookSynchronizationSettings":false,"item/ExportRelationshipRoles":false,"item/ExportIsvConfig":false,"item/ExportSales":false,"item/ExportExternalApplications":false},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"edad8a33-5ab0-4c3d-a680-50a83e69b75c"}}},"runAfter":{},"metadata":{"operationMetadataId":"c90a84c1-5f8f-47e6-85f4-6623ced4d4a5"}}},"runAfter":{"Internal_Name_Solution":["Succeeded"]},"metadata":{"operationMetadataId":"6c0733ea-b6b6-4001-a26c-ed0db7210b7c"}}}
⑴ Restore Solution

{"id":"964018a8-e7ef-492a-bfa9-2e7cce95b021","brandColor":"#8C3900","connectionReferences":{"shared_commondataserviceforapps":{"connection":{"id":"/crce7_sharedcommondataserviceforapps_6ab0c"}},"shared_onedriveforbusiness":{"connection":{"id":"/new_sharedonedriveforbusiness_58eca"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Restore_Solution_from_Backup","operationDefinition":{"type":"Scope","actions":{"Variable":{"type":"Scope","actions":{"Get_file_content":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_onedriveforbusiness","operationId":"GetFileContent","apiId":"/providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness"},"parameters":{"id":"b!QXDMTJQWzUmH3MxDXM6y2k-CtYhPjl5HilY3d7yppydZpLeqflXvQ48pC25vRXdt.01CIDL2ECPUIU3O3JADJGLR2SXFASROBGM","inferContentType":true},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"b!QXDMTJQWzUmH3MxDXM6y2k-CtYhPjl5HilY3d7yppydZpLeqflXvQ48pC25vRXdt.01CIDL2EE4FZKSV3QPS5GYUFKFJOPVQ5AV":"/Backup PowerAutomate/BackUpFlows_2022-08-25T06_21_29.3169365Z.zip","operationMetadataId":"09bf45eb-aeac-4f1d-9377-070b3b12c08c","b!QXDMTJQWzUmH3MxDXM6y2k-CtYhPjl5HilY3d7yppydZpLeqflXvQ48pC25vRXdt.01CIDL2ECPUIU3O3JADJGLR2SXFASROBGM":"/Backup PowerAutomate/BackUpFlows_2022-08-25T08_03_00.9379160Z.zip"}}},"runAfter":{},"metadata":{"operationMetadataId":"8d687a2b-1291-4c58-95e6-fdf620002d9c"}},"Restore_Solution":{"type":"Scope","actions":{"Perform_an_unbound_action_2":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"PerformUnboundAction","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"actionName":"ImportSolution","item/OverwriteUnmanagedCustomizations":false,"item/PublishWorkflows":false,"item/CustomizationFile":"@body('Get_file_content')?['$content']","item/ImportJobId":"@guid()","item/ConvertToManaged":false,"item/SkipProductUpdateDependencies":false,"item/HoldingSolution":false,"item/SkipQueueRibbonJob":false,"item/AsyncRibbonProcessing":false,"item/IsTemplateMode":false},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"f2828b0f-4f92-4760-92bc-afee9c2b2c24"}}},"runAfter":{"Variable":["Succeeded"]},"metadata":{"operationMetadataId":"c90a84c1-5f8f-47e6-85f4-6623ced4d4a5"}}},"runAfter":{},"metadata":{"operationMetadataId":"6c0733ea-b6b6-4001-a26c-ed0db7210b7c"}}}
⑵ Backup Flow

{"id":"2bd5f6d6-9716-41a7-be39-2997816c8d16","brandColor":"#8C3900","connectionReferences":{"shared_flowmanagement_1":{"connection":{"id":"/new_sharedflowmanagement_78283"}},"shared_onedriveforbusiness_1":{"connection":{"id":"/new_sharedonedriveforbusiness_58eca"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Export_Flow_to_OneDrive","operationDefinition":{"type":"Scope","actions":{"Variable":{"type":"Compose","inputs":{"FlowID":"@{triggerBody()['text']}","EnvironmentID":"@{triggerBody()['text_1']}"},"runAfter":{},"metadata":{"operationMetadataId":"bad376d5-dcd4-4d8d-84a5-a844b2609e42"}},"Export_Flow":{"type":"Scope","actions":{"Create_file":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_onedriveforbusiness_1","operationId":"CreateFile","apiId":"/providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness"},"parameters":{"folderPath":"/Backup PowerAutomate","name":"@{outputs('Get_Flow')?['body/properties/displayName']}_@{utcNow()}.json","body":"@outputs('Get_Flow')?['body/properties/definition']"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Get_Flow":["Succeeded"]},"runtimeConfiguration":{"contentTransfer":{"transferMode":"Chunked"}},"metadata":{"operationMetadataId":"7ff3d5a1-7d47-4c43-a070-339fa0a8d843"}},"Get_Flow":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_flowmanagement_1","operationId":"GetFlow","apiId":"/providers/Microsoft.PowerApps/apis/shared_flowmanagement"},"parameters":{"environmentName":"@outputs('Variable')?['EnvironmentID']","flowName":"@outputs('Variable')?['FlowID']"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"a77f80ac-0fbd-43b0-963b-61ce4147c4e7"}}},"runAfter":{"Variable":["Succeeded"]},"metadata":{"operationMetadataId":"09062054-0acf-44ec-9062-42c3f4941dae"}},"Respond_to_a_PowerApp_or_flow":{"type":"Response","kind":"PowerApp","inputs":{"statusCode":200,"body":{},"schema":{"type":"object","properties":{}}},"runAfter":{"Export_Flow":["Succeeded"]},"metadata":{"operationMetadataId":"39dc65eb-e56d-4705-98fc-7c4848c84250"}}},"runAfter":{},"metadata":{"operationMetadataId":"490611db-6ad2-42a9-8a94-907af94b8b02"}}}
⑵ Restore Flow

{"id":"e79a25a8-388d-4000-9393-75002528e62a","brandColor":"#8C3900","connectionReferences":{"shared_flowmanagement":{"connection":{"id":"/new_sharedflowmanagement_78283"}},"shared_onedriveforbusiness":{"connection":{"id":"/new_sharedonedriveforbusiness_58eca"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Restore_a_Flow","operationDefinition":{"type":"Scope","actions":{"Initial":{"type":"Scope","actions":{"Variable":{"type":"Compose","inputs":{"EnvironmentID":"@{triggerBody()['text']}","UpdateFlowID":"@{triggerBody()['text_1']}","UpdateFlowName":"@{triggerBody()['text_2']}"},"runAfter":{},"metadata":{"operationMetadataId":"c0607e6e-d7c1-488e-ac2e-1d12c4231ef2"}},"Get_file_content":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_onedriveforbusiness","operationId":"GetFileContentByPath","apiId":"/providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness"},"parameters":{"path":"@triggerBody()['text_3']","inferContentType":true},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{"Variable":["Succeeded"]},"metadata":{"operationMetadataId":"9c52e3cf-14c7-418f-afd7-3d280de3cd27"}}},"runAfter":{},"metadata":{"operationMetadataId":"b9a56542-73f6-479b-98a2-135a3780610d"}},"Restore":{"type":"Scope","actions":{"Update_Flow_2":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_flowmanagement","operationId":"UpdateFlow","apiId":"/providers/Microsoft.PowerApps/apis/shared_flowmanagement"},"parameters":{"environmentName":"@outputs('Variable')?['EnvironmentID']","flowName":"@outputs('Variable')?['UpdateFlowID']","Flow/properties/displayName":"@outputs('Variable')?['UpdateFlowName']","Flow/properties/definition":"@json(base64ToString(base64(outputs('Get_file_content')?['body'])))","Flow/properties/state":"Started"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"d2b0566a-39b9-4018-ad11-40f99a8d20e5"}}},"runAfter":{"Initial":["Succeeded"]},"metadata":{"operationMetadataId":"dc698232-d1b6-4dcc-9ef1-a7b1bf16190e"}},"Respond_to_a_PowerApp_or_flow":{"type":"Response","kind":"PowerApp","inputs":{"statusCode":200,"body":{},"schema":{"type":"object","properties":{}}},"runAfter":{"Restore":["Succeeded"]},"metadata":{"operationMetadataId":"a602c08b-2fb1-433f-9d7a-5dbb209633f2"}}},"runAfter":{},"metadata":{"operationMetadataId":"513126e8-94f3-4648-9c46-74d4373a773a"}}}