cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vbvbvb
Microsoft
Microsoft

Post an card to a Teams and wait for a response - can other actions run in parallel until Action.Submit?

I am trying to make a delayed action Flow to combine into current design with using Post an adaptive card to a Teams channel and wait for a response.

 

So, theoretically, when this this action is performed, Flow posts adaptive card to Teams channel and sets itself to "Running" state until action is complete.  Let's say it has button in the card with Action.Submit:

 

{
"type": "Action.Submit",
"title": "Press the Button"
}

 

And if I create Condition after card action, with:  @body('MyCard')['submitActionID'] is equal to "Press the Button", once button is pressed, Flow goes on with further steps.

 

Is it possible to make a parallel branch with Delay actions and keep posting replies to the card message until button is pressed?

So far all my attempts to make paralleling branching logic fail because until action.submit is 'pressed', nothing keep happening.

 

The goal is to have Flow posting replies under original card message using Post reply to a message V2 every 15 minutes, unless "Press the Button" is pressed, then just stop and terminate

 
1 ACCEPTED SOLUTION

Accepted Solutions

Hello @vbvbvb 

I made a simple test - by using a variable, you can pass information between branches - so when the adaptive card is submitted, a variable is set to for example "Done" and in the other branch, the Do until loop runs till the same variable is equal to "Done".

But you are right, identifying the post that the adaptive card is in to get the message id may be hard.

Anyway, interesting problem, hope you find a solution 🙂

Kind regards, John

View solution in original post

5 REPLIES 5
JohnAageAnderse
Super User
Super User

Hello @vbvbvb 

Not sure this is possible, but could you not make the parellel branching before posting the adaptive card?

 

The first branch will post the adaptive card to the Teams and wait ...

The second branch will delay 15 min, then loop using a Do until in which it will get messages from the Teams, check among those that the adaptive card post is still active, then post a reply, and delay 15 min.

 

Completely not sure about the above 🙂

Kind regards, John

Hi @JohnAageAnderse , I thought about that in such way:

Capture.PNG

But then parallel branch has no reference to MessageID of Adaptive card , nor SubmitActionID . Maybe as you said, best way if to make parallel branch to look for specific reply which is posted when "Press the Button" is submitted - there can be some filtering applies from Get messages Teams action - but then it would super complicated logic to say the least 🙂

Also i am still not sure how to make paralleled branch to stop posting replies when Submit.action is done.

Hello @vbvbvb 

I made a simple test - by using a variable, you can pass information between branches - so when the adaptive card is submitted, a variable is set to for example "Done" and in the other branch, the Do until loop runs till the same variable is equal to "Done".

But you are right, identifying the post that the adaptive card is in to get the message id may be hard.

Anyway, interesting problem, hope you find a solution 🙂

Kind regards, John

View solution in original post

Thanks, will try that now - you used simple string value in variable?

 

I actually do have a workaround for message ID and someone recently on this forum posted this too - https://knowhere365.space/power-automate-reply-to-an-adaptive-card-post-in-microsoft-teams/.

 

In my case, I have messageID as variable by using Http request to Azure AD with Graph query for last 50 Teams messages and then filtering content for 1 unique identifier and then Parsing JSON to get "ID" and then Set as Variable (bit much, but it works 🙂

 

 

 

So, to recap:

 

1. Initialise Variable (string), let's call it "ActionComplete" 

2. After Condition which is set to SubmitActionID = Press The Button:

3. Set Variable "ActionComplete" , value ="Done"

4. Parallel branch , Do Until - > condition "ActionComplete" = Done.

 

Testing this now.

 

UPD: Yeah, I can confirm that conceptually this does work. I set delay to 10 seconds, so replies were flying in until Submit.Action was triggered and action of Set Variable was taken to consideration. Now need to make some refinements and think about next challenge - i need replies to have different text after each next 15 minute iteration 🙂 

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (47,161)