web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automated Workflow iss...
Power Automate
Suggested Answer

Automated Workflow issue with Looping and Conditions not working appropriately

(0) ShareShare
ReportReport
Posted on by
I have an automated workflow that uses a Trigger from Shifts, actions from Teams, and 1 condition. The Workflow goes like this: 
 
(Trigger) "When an an Open Shift is created, updated or deleted" --> (action) "Post Adaptive Card and wait for a response" --> (Condition) "Or" (Note: using Dynamic Content for values)
 
Expression 1: "outputs('Post_adaptive_card_and_wait_for_a_response')?['body/data/response']" is equal to "Approve" 
Expression 2: "outputs('Post_adaptive_card_and_wait_for_a_response')?['body/data/response']" is equal to "Decline"
 
"True" (Branch 1) --> (Action) "Approve an Open Shift Request" --> (Action) "Post Message in Chat or channel" (approved confirmation message)
"False" (Branch 2) --> (Action) "Decline an Open Shift Request" --> (Action) "Post Message in Chat or channel" (Declined confirmation message)  
 
Trends
  1. When an Open Shift is requested, the trigger posts an adaptive card that has a "approve" and a "decline" button to a chat.
  2. When approved, a "Thank you for your response" message is sent, then a message is posted in chat saying "your open shift request has been approved," and the Open Shift requested is successfully approved and recorded in the scheduling group
  3. When Declined, a "Thank you for your response message is sent, then a message is posted in chat saying "your open shift request has been approved", and the Open shift requested is approved NOT declined/denied, and records in the scheduling group as approved, so regardless of response the Open Shift is approved
  4. When responding to the adaptive card for the first time, after selecting "approve" or "Decline" buttons, the loop starts again, and the adaptive card is posted again because of original trigger. 
Questions
  1. How to I prevent the flow from looping/re-starting again when I respond to the adaptive card with the two buttons awaiting a response? Do I have to add another condition or a "terminate" control? If so, what section would the condition or control be in the workflow? 
  2.  What is wrong in with the "or" condition or the expressions? How can I make them react appropriately to the approve or decline actions? 
  3. Is the problem in my Adaptive Card JSON code? If so what needs to be changed? 
 
Adaptive Card JSON: 
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.3",
"body": [
{
"type": "TextBlock",
"text": "Open Shift Request",
"weight": "Bolder",
"size": "Medium"
},
{
"type": "TextBlock",
"text": "An Open Shift request has been created. Please reply with your decision.",
"wrap": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Approve",
"data": { "response": "Approved" }
},
{
"type": "Action.Submit",
"title": "Decline",
"data": { "response": "Declined" }
}
]
}
Screenshot 2026-0...
Screenshot 2026-0...
Screenshot 2026-0...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    You’re hitting two common Power Automate issues here: a re‑triggering loop and an always‑true condition.

    1) Looping:
    Responding to the adaptive card updates the Open Shift, which causes the Shifts trigger to fire again.
    To stop this:
         Filter the trigger to only run on Created events
         Or add a Condition immediately after the trigger to exit if the shift is already approved/declined
         A Terminate control won’t help unless you block the trigger first
     
    2) Condition Logic:
    Your condition is incorrect. Using OR (Approve OR Decline) will always evaluate to true.
    Instead:
         Condition: response equals "Approved"
         Yes --> Approve shift
         No --> Decline shift
     
    Adaptive Card JSON is fine. The issue is the OR condition and missing trigger guard.
    Once you filter the trigger and simplify the condition, both the looping and incorrect approvals will stop.
     
    High level flow:
    Trigger: When an open shift is created, updated, or deleted

    Condition: status == 'Pending'

    ├─ Yes:
    │ ├─ Post Adaptive Card and wait for response
    │ ├─ Condition: response == 'Approved'
    │ │ ├─ Yes --> Approve Open Shift
    │ │ └─ No --> Decline Open Shift

    └─ No:
    └─ Terminate (Succeeded)
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard