1

How can I write a flow that 'waits' for a site to be provisioned before continuing to copy files to it?

I need to ensure that any site is fully provisioned and available before copying template document libraries to it.

2 Answers2

1

Here is the solution. It waits until the Site is available with an Id. Initially we thought that using the default script timeout and/or the number of retries would do it but the retries does not seem to work in that way, so a manual do Until is required.

Notes:

  1. This does an HTTP check for the Id of the site. Other calls can be made according to your requirements. Elsewhere we are using the 'built in' SharePoint Flow of 'Get Folder' to ensure that a folder exists before copying to it (and waiting accordingly in case it has not been provisioned)

  2. The 'Run After' Parameter (accessed via the three dots) on the Set Variable is set to 'is successful'

  3. The 'Run After' Parameter on the Delay is set to 'has failed' + 'is skipped' + 'has timed out'

  4. This is a simplistic case of success or failure. Additional checks for return status can be made from any call.

enter image description here

0

You could consider doing a HTTP GET request to an endpoint that only returns HTTP Code 200 OK once provisioning is complete. Combine it with a Loop to check for the response code and some fixed delay action. Please be aware in order to do HTTP requests you need a per-user plan or some other license to allow this action.

jausen brett
  • 1,111
  • 7
  • 10