cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Site Creation flow, Create library approval workflow

I'm working on a self service site creation workflow for a real estate agency. The last part I need to implement is a library approval workflow for the new sites. Since each site will need their own workflow I'm using the "Create Flow" action within my site creation flow.

 

I only need to change 2 values within the Flow Definition:

  • The Site Address for the trigger
  • Property Item ID in my second step. 

 

I first tried using Compose and the replace expression to fix the URL's. 
replace(body('getCorrespondenceFlow')['properties']['definition'], 'https://tenant.sharepoint.com/Site%20Template', variables(SiteURL)) 
Since the Flow Definition is an object, replace does not work.
 
I also tried composing the Flow Definition manually using the output from "Get Flow". That causes a host of other problems since it was trying to resolve variables from the flow template.
 
Does anyone know of a way to find and replace values inside of an object using flow? Am I approaching this the wrong way entirely?
 
Deeper Explanation below.
I first need to replace the site URL for the "path" value in the trigger.
   "triggers": {
      "onDraftUpload": {
        "recurrence": {
          "frequency": "Minute",
          "interval": 3
        },
        "metadata": {
          "%252fDraft%2bCorrespondence": "/Draft Correspondence",
          "flowSystemMetadata": {
            "swaggerOperationId": "OnNewFile"
          }
        },
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['shared_sharepointonline']['connectionId']"
            }
          },
          "method": "get",
          "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://tenant.sharepoint.com/Site%20Template'))}/triggers/onnewfile",
          "queries": {
            "folderId": "%252fDraft%2bCorrespondence",
            "queryParametersSingleEncoded": true,
            "inferContentType": true
          },
          "authentication": "@parameters('$authentication')"
        }
      }
I then need to replace "99999" in "path" again for my get item step.
      "getProperty": {
        "runAfter": {},
        "metadata": {
          "flowSystemMetadata": {
            "swaggerOperationId": "GetItem"
          }
        },
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['shared_sharepointonline']['connectionId']"
            }
          },
          "method": "get",
          "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://tenant.sharepoint.com/'))}/tables/@{encodeURIComponent(encodeURIComponent('a4626489-ea45-4c2...')}",
          "authentication": "@parameters('$authentication')"
        }
      }
 
 
 

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (6,733)