cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NielsL
Helper V
Helper V

Trigger flow from URL in email

Hi,

 

On a monthly basis, I would like to send and email to our users asking them a simple Yes/No questions. Their answer should then update a record that exist in CDS.

 

Is it possible to create an URL with parameters, that triggers a flow which updates a record in CDS? E.g. if the user click the Yes link in the email, the record will be updated accordingly?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi

'When a HTTP is received' is an independent flow listening for users clicking on 'Yes' or 'No' link.

You can see the technique in this flow example I am currently using:

Flow_relativePathListener.png

So on the email I am implementing different links, all of them pointing to this second flow.

Depending on the link I click on, the variables defind on relativePath: {currentOEM}, {MessageID} and {DekaCertificationID} take different values.

 

In your case, you will need to handle a variable to track the record the response is related (user responding), another variable to identify the question you are making, and a third one for the answer given.

When user X clicks a YES/NO answer, your second flow is executed, you get user identity from user variable, you also identify the question from question variable, and finally identify answer from answer variable

 

So your relativePAth should probably look like this:

recordID/{recordID}/questionID/{questionID}/answerValue/{answerValue}

 

I would suggest you to build your second flow following this advice, add relativePath to the trigger, make sure method is set as GET instead of POST. Then add it a dummy Compose action block to print the variables you are getting from the URL.

SAve it, and copy the trigger URL by clicking the icon on the right.

Flow_relativePathListener2.png

The https URI I get from my example has this format:

xxxxxx.westeurope.logic.azure.com/workflows/yyyyyyyyyyyyy/triggers/manual/paths/invoke/OEM/{currentOEM}/Message/{MessageID}/DekraCertification/{DekraCertificationID}?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=zzzzzzzzzzzzzzzzzz

 

Then paste the URL (dont forget https://) on your browser, replace {variables} with dummy values, hit Enter and see this new PA flow execution. If succeded, you can add relevant steps after the dummy Compose, i.e. update the record identified by the recordID in the URL with the given answer.

 

Once you achieve this, we can start working with the URLs to be added to the email

Please note this technique has some security concerns

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

6 REPLIES 6
efialttes
Super User
Super User

Yes!

Please have a look to 'When a HTTP is received' trigger in this official link:

https://docs.microsoft.com/en-us/azure/connectors/connectors-native-reqres

Since you will trigger the flow from a link in an email, yuo should add parameter values on the Request URI, this means you need to declare them in the trigger Relative path instead of JSON body. THis technique is explained here:
https://powerusers.microsoft.com/t5/General-Power-Automate/HTTP-request-trigger-MS-Flow/td-p/83574

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



@efialttesthanks for the input. I think I need a bit more guidance on this as I really don't not where to start with this HTTP/jason stuff 😊

 

My initial thought was to build the flow like this - but do I need to start the with the 'When a HTTP is received'?

 

1. Trigger the flow on a monthly basis

2. Find the users that needs to be notified

3. For each user, create a new record

4. Send an email to the user with Yes and No links

5. Update the the record created in step 3 with Yes or No based on the input from the email

 

Like this:

Capture.PNG

 

 

 

Hi

'When a HTTP is received' is an independent flow listening for users clicking on 'Yes' or 'No' link.

You can see the technique in this flow example I am currently using:

Flow_relativePathListener.png

So on the email I am implementing different links, all of them pointing to this second flow.

Depending on the link I click on, the variables defind on relativePath: {currentOEM}, {MessageID} and {DekaCertificationID} take different values.

 

In your case, you will need to handle a variable to track the record the response is related (user responding), another variable to identify the question you are making, and a third one for the answer given.

When user X clicks a YES/NO answer, your second flow is executed, you get user identity from user variable, you also identify the question from question variable, and finally identify answer from answer variable

 

So your relativePAth should probably look like this:

recordID/{recordID}/questionID/{questionID}/answerValue/{answerValue}

 

I would suggest you to build your second flow following this advice, add relativePath to the trigger, make sure method is set as GET instead of POST. Then add it a dummy Compose action block to print the variables you are getting from the URL.

SAve it, and copy the trigger URL by clicking the icon on the right.

Flow_relativePathListener2.png

The https URI I get from my example has this format:

xxxxxx.westeurope.logic.azure.com/workflows/yyyyyyyyyyyyy/triggers/manual/paths/invoke/OEM/{currentOEM}/Message/{MessageID}/DekraCertification/{DekraCertificationID}?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=zzzzzzzzzzzzzzzzzz

 

Then paste the URL (dont forget https://) on your browser, replace {variables} with dummy values, hit Enter and see this new PA flow execution. If succeded, you can add relevant steps after the dummy Compose, i.e. update the record identified by the recordID in the URL with the given answer.

 

Once you achieve this, we can start working with the URLs to be added to the email

Please note this technique has some security concerns

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

@efialttesthanks for the thorough reply. 

 

Right now, this seems a bit to steep for me. Moreover, it might also a bit of overkill compared to what I'm trying to save a few clicks with 🙂 

 

There are also some licenseing questions, when I run a flow that's not triggered from my Dynamics 365 environment - and then you also mention security concerns. 

 

It might be something I come  back to later to investigate the possibilities. And I hope others will find your posts helpful. 

 

Once again, thanks for the help. 

@NielsL 

Thank you for your kindness, I understand your concerns since the scenario discussed is one of the trickiest with Microsoft Flow.

Hope to hear from you if you manage to get it working in the future, in the meantime we will continue trying to help this community to keep on growing

BR

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



roshanma
Frequent Visitor

Can i get email subject without adding it to link parameters?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,989)