cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Sailela
Level: Powered On

"Start point" for automated Flows (or trigger events for planned flows)

Hello,

 

I need a time selection as "Start point" for automated Flows to add trigger events for future Flows that need to planned right now.

I can´t find a way to combine a planned flow with trigger events. For planned flows you can only set a fixed time period to sync data.

 

Can you help me?

 

Thank you very much

Elias

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: "Start point" for automated Flows (or trigger events for planned flows)

Hey @Sailela 

 

OK, now it makes more sense. I think I got it, so let's do this.

 

I'll describe two solutions, one based on you having a premium account.

 

TRIGGERING THE FLOWS

Solution 1 - Premium Account

Put all your logic into one flow that triggers using a Request trigger. This way, you'll have everything in one place and only have to create a simple Flow for each month. Any change in the logic you can do in one Flow, and you don't need to change all the other nine flows. You can even pass parameters if you need them. Then you only need something like this in the Global flow:

 

small-Screenshot_2019-10-17_at_09_57_00.jpg

 

 

Then to call it you need to do the following:small-Screenshot_2019-10-18_at_10_06_02.jpg

 

Solution 2 - Have a template Flow

Create your Flow with the basic structure and copy it over and over as you need more folders. Not as elegant, but it works and saves you time.

 

 

PROCESSING THE CURRENT MONTH

I'm assuming that each folder since they represent a month, they will have a name that identifies the month. I'll use it for this example, the name of the month in English. For example: /List/October/....

 

small-Screenshot_2019-10-18_at_10_09_35.jpg

 

With this in mind, create the following Flow and use the "Save As" to create multiple new Flows.

 

After that, it's simple. If it isn't the current month, even if someone creates a file, the flow will end.

 

Here's the full flow:

small-Screenshot_2019-10-18_at_10_34_37.jpg

 

Here are the formulas for both Compose Actions:

 

Get's the current month formatted like 'October':

 

formatDateTime(utcNow(),'MMMM')

 

 

Does the file ID contain the month collected before?

contains(triggerOutputs()['headers']['x-ms-file-id'],outputs('Compose'))

 

It looks complicated but it isn't. If you don't understand something, please let me know, and I'll clarify it.

 

With this strategy, you only need to "Save as" and change the folder and all will work for any month, saving you time.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

View solution in original post

5 REPLIES 5

Re: "Start point" for automated Flows (or trigger events for planned flows)

HI @Sailela,

 

Let me see if I understood you correctly. You want a flow to fire at "random times" to trigger other Flows correct?

 

Let's call the first flow the "main flow" and the other the "aux flows". For the main flow, you always need to use the scheduled trigger, but you're not forced to proceed if it's not the "right time." Just keep your "Start point" somewhere and check it once the central flow fires. If it's not time yet, end the flow. If it is, here's how to call the aux flows.

 

Call aux flows

Create a "Request" trigger. In your main flow, when it's time to call them, just use the HTTP action, and you're good to go. You can even call multiple Flows based on your use logic. Here are some examples of each:

 

The HTTP request. You can even have parameters sent to the aux Flows. For that just use a simple JSON format and you're good to go.

small-Screenshot_2019-10-17_at_09_57_00.jpg

 

 

To call from your main Flow, just do a simple HTTP post. small-Screenshot_2019-10-17_at_09_58_20.jpg

 

Is this what you need? If now I'm sure we can figure this out, so please give me more information, and I'll help you.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

 

Sailela
Level: Powered On

Re: "Start point" for automated Flows (or trigger events for planned flows)

Hey Manuel,

 

wow, thank you very much for your answer! 

 

Not sure if I got it. Or maybe I should explain in more detail.

 

I need to create flows for 10 folders within a library (will be more in future) while every folder stands for one month. We want to create one single flow for each folder. 

The flow itself has to fire at random times (when a file is created or changed) but only for the current month. 

 

It is important for us to do so because we won´t have time in future to activate the new flow/deactivate the old flow when the new month starts. we also need a clear cut between the months. That is why I want to create all flows right now.

 

Do you have any ideas?

 

Thanks again and greetings from germany

Elias

 

Super User
Super User

Re: "Start point" for automated Flows (or trigger events for planned flows)

@Sailela 

Please remember that the HTTP action which is currently required to call one Flow from another is a premium feature.  You need a premium Flow license in order to use this feature.

Also, can you explain the business use case - that might make it a bit easier to understand your requirement.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Re: "Start point" for automated Flows (or trigger events for planned flows)

Hey @Sailela 

 

OK, now it makes more sense. I think I got it, so let's do this.

 

I'll describe two solutions, one based on you having a premium account.

 

TRIGGERING THE FLOWS

Solution 1 - Premium Account

Put all your logic into one flow that triggers using a Request trigger. This way, you'll have everything in one place and only have to create a simple Flow for each month. Any change in the logic you can do in one Flow, and you don't need to change all the other nine flows. You can even pass parameters if you need them. Then you only need something like this in the Global flow:

 

small-Screenshot_2019-10-17_at_09_57_00.jpg

 

 

Then to call it you need to do the following:small-Screenshot_2019-10-18_at_10_06_02.jpg

 

Solution 2 - Have a template Flow

Create your Flow with the basic structure and copy it over and over as you need more folders. Not as elegant, but it works and saves you time.

 

 

PROCESSING THE CURRENT MONTH

I'm assuming that each folder since they represent a month, they will have a name that identifies the month. I'll use it for this example, the name of the month in English. For example: /List/October/....

 

small-Screenshot_2019-10-18_at_10_09_35.jpg

 

With this in mind, create the following Flow and use the "Save As" to create multiple new Flows.

 

After that, it's simple. If it isn't the current month, even if someone creates a file, the flow will end.

 

Here's the full flow:

small-Screenshot_2019-10-18_at_10_34_37.jpg

 

Here are the formulas for both Compose Actions:

 

Get's the current month formatted like 'October':

 

formatDateTime(utcNow(),'MMMM')

 

 

Does the file ID contain the month collected before?

contains(triggerOutputs()['headers']['x-ms-file-id'],outputs('Compose'))

 

It looks complicated but it isn't. If you don't understand something, please let me know, and I'll clarify it.

 

With this strategy, you only need to "Save as" and change the folder and all will work for any month, saving you time.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

 

View solution in original post

Sailela
Level: Powered On

Re: "Start point" for automated Flows (or trigger events for planned flows)

Hey Manuel,

thank you so much!

I will use your first solution - we already have premium accounts. You really helped us. this is the cause for though I needed.
Again, thank for your time!

Elias

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users Online
Currently online: 339 members 5,913 guests
Please welcome our newest community members: