cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CarloG
Helper I
Helper I

Adding extra information when a flow is ended

Hi all, hope you are all right in this pandemic situation.

I'm currently working on a couple flows where I'm kind of stuck in understanding how to approach an "evolution" of it as some operations are still manual.

 

Please I'm open to any advices, even if this means to rebuild everything from ground.

 

The two flows does different things but they share this "baseline issue".

 

Long story short, the two flows works this way:

1) A MS Form is filled with some information

2) A row is added to a SharePoint list with all the information and an approval process with some ppl top-down happens

3) for each approval step, the sharepoint item is updated with the timestamp of the approval

4) in the final approval, emails gets sent out (in one flow) and in another flow Word documents gets created based on a template

 

So far so good. Here comes the problem.

 

In one of the flows, in the middle an email is sent to some people that needs to provide back some information to be added to the sharepoint list. At the moment, they reply to the email and the piece of information is added manually. Is there any way to automate this? Consider also that it might happen that the same person can receive two request at one time so two different rows needs to be updated.

 

In another flow, after the flow ended, in a future timeframe (weeks or months) it's needed to create a new word document that takes as baseline the information of the previous flow and add extra information.

To make this understandable, let's say the flow create a word with some customer info and a question that someone else needs to give an answer. From there, it needs to generate a new word with the same information as the original (taken from sharepoint) but also with the answer recieved. How is this possible?

I was thinking at a separate flow, but starting with a form I'm not able to select the right row from sharepoint (like a dropdown) with the information I need...

 

Thanks for the help in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

@CarloG  you can use actionable messages (adaptive cards) in outlook, you can do as per sample described below:

 

You will need two flows here, one flow will send email with option to enter input in email and second flow will take the user input and store that user input back to SharePoint list

 

First Flow: to send email with input option

 

1. You can design your own adaptive card here Designer | Adaptive Cards or use below sample adaptive card json. Please note that if you design your own adaptive card, please add the <script> tag in the start and end of json as it has been added in below json

<script type="application/adaptivecard+json">
{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "TextBlock",
            "text": "Please provide information",
            "size": "Large",
            "weight": "Bolder",
            "wrap": true
        },
        {
            "type": "TextBlock",
            "text": "Select Color",
            "wrap": true,
            "id": "c"
        },
        {
            "type": "Input.ChoiceSet",
            "id": "color",
            "value": "",
            "choices": [
                {
                    "title": "Red",
                    "value": "Red"
                },
                {
                    "title": "Blue",
                    "value": "Blue"
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "Comments",
            "wrap": true
        },
        {
            "type": "Input.Text",
            "placeholder": "Placeholder text",
            "id": "Comments"
        }
    ],
    "actions": [
        {
            "type": "Action.Http",
            "title": "Submit",
            "id": "SubmitButton",
            "method": "POST",
            "url": "<URL to flow HTTP request>",
            "body": "{\n\"color\":\"{{color.value}}\",\n\"comments\":\"{{comments.value}}\"\n}",
"headers": [  
                {  
                    "name": "Authorization",  
                    "value": ""  
                },  
                {  
                    "name": "Content-type",  
                    "value": "application/json"  
                }  
            ] 
        }
    ]
}
</script>

 

The adaptive card will look as follow:

 

 

{
"color":"",
"comments":""
}

 

So now your trigger json schema will look as follows:

Screenshot 2021-02-11 171010.png

5. Now you can add update item action to the second flow to update the response from user from email, you will get the response from the HTTP trigger dynamic content

 
{
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "text": "Your response is submitted",
          "id": "response text"
        }
      ]
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}

b. Now add Response (http) action to the second flow and configure it as shown below, in the body parameter, select output of compose action from dynamic content

Screenshot 2021-02-11 171634.png

Now the main important step, save the second flow and you will get a HTTP POST URL in the HTTP trigger, copy that Post URL and paste it in place of <URL to Flow HTTP request> in the adaptive card json (this will be in your first flow compose action, the flow which sends the email)

 

Please note this approach requires to use premium connectors i.e. HTTP connectors.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
annajhaveri
Super User
Super User

@CarloG You can use the Start and Wait for approval with custom responses to get response from the user in email. The only thing is flow will wait for user to respond, i didnt get whether you want the flow to wait for response in both scenarios.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
CarloG
Helper I
Helper I

Hi, this might work for the first one but how long a process can hang before a reply is given?

Also, it's possible to have the rest of the flow working meanwhile?

 

On the 2nd one it would not solve, let me explain with a basic example

I've a sharepoint list with 3 items: Banana, Apple and Peach, generated with another flow.

I need a flow where a user has to add the color of the fruit, but the user need to select for what fruit he's adding the color to.

Since you cannot add a dropdown menu in MS Form (I mainly use that for triggering flow since I need also inputs from users) that reads the item in the list, how you would proceed?

@CarloG  okay lets go step by step, lets first resolve the first scenario. The flow will wait for response from user if you are using Start and Wait for approval, it will wait for user to provide the input. You want the rest of the flow working while the user provides the input? Also do you want the flow to do something differently when user provides the input value?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
CarloG
Helper I
Helper I

Yes, but I do not want to use the "wait for approval" trigger, as this means they can deny: There is not another way to make the user to provide the value?

And no, I do not want the flow to change behaviour based on the user input: it is just a field that is needed later on for other internal things for another department

 

I just need a way to have a user to add an extra input in the middle of the flow without changing anything else on the flow.

 

Just an extra input that the user that trigger the flow does not have.

 

Using the example before, I trigger a flow to add "Apple" but only you know that that apple is Red, so you have to add the "Red" input. Makes sense?

@CarloG  you can use actionable messages (adaptive cards) in outlook, you can do as per sample described below:

 

You will need two flows here, one flow will send email with option to enter input in email and second flow will take the user input and store that user input back to SharePoint list

 

First Flow: to send email with input option

 

1. You can design your own adaptive card here Designer | Adaptive Cards or use below sample adaptive card json. Please note that if you design your own adaptive card, please add the <script> tag in the start and end of json as it has been added in below json

<script type="application/adaptivecard+json">
{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "TextBlock",
            "text": "Please provide information",
            "size": "Large",
            "weight": "Bolder",
            "wrap": true
        },
        {
            "type": "TextBlock",
            "text": "Select Color",
            "wrap": true,
            "id": "c"
        },
        {
            "type": "Input.ChoiceSet",
            "id": "color",
            "value": "",
            "choices": [
                {
                    "title": "Red",
                    "value": "Red"
                },
                {
                    "title": "Blue",
                    "value": "Blue"
                }
            ]
        },
        {
            "type": "TextBlock",
            "text": "Comments",
            "wrap": true
        },
        {
            "type": "Input.Text",
            "placeholder": "Placeholder text",
            "id": "Comments"
        }
    ],
    "actions": [
        {
            "type": "Action.Http",
            "title": "Submit",
            "id": "SubmitButton",
            "method": "POST",
            "url": "<URL to flow HTTP request>",
            "body": "{\n\"color\":\"{{color.value}}\",\n\"comments\":\"{{comments.value}}\"\n}",
"headers": [  
                {  
                    "name": "Authorization",  
                    "value": ""  
                },  
                {  
                    "name": "Content-type",  
                    "value": "application/json"  
                }  
            ] 
        }
    ]
}
</script>

 

The adaptive card will look as follow:

 

 

{
"color":"",
"comments":""
}

 

So now your trigger json schema will look as follows:

Screenshot 2021-02-11 171010.png

5. Now you can add update item action to the second flow to update the response from user from email, you will get the response from the HTTP trigger dynamic content

 
{
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "text": "Your response is submitted",
          "id": "response text"
        }
      ]
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}

b. Now add Response (http) action to the second flow and configure it as shown below, in the body parameter, select output of compose action from dynamic content

Screenshot 2021-02-11 171634.png

Now the main important step, save the second flow and you will get a HTTP POST URL in the HTTP trigger, copy that Post URL and paste it in place of <URL to Flow HTTP request> in the adaptive card json (this will be in your first flow compose action, the flow which sends the email)

 

Please note this approach requires to use premium connectors i.e. HTTP connectors.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

CarloG
Helper I
Helper I

Thanks, this work! for the other problem, I found a solution: at the end i'm implementing Business Process ad it will work as intended!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,646)