Posts

Showing posts from May, 2022

Start power automate on new or modified document only when a condition is met

Image
Starting a Power Automate flow on a new or changed document or item is easy. But can you only start it when a certain condition is met?  Yes, you can. In this example I only want to start the flow when the field "Document Status" is set to "To review". Here's how. The trigger for this flow is: When a file is created or modified We need to go to the settings of this action... Add a trigger condition... @equals(triggerOutputs()?['body/Document_x0020_Status/Value'], 'To review') Click Done and now the flow will only start if the condition is met. Bonus tip! If you find it hard to create the trigger condition expression do this: Pick the field you want to compare against... Enter the value and click on "Edit in advanced mode"  Select the expression and copy it into the trigger action from above. After this you can delete the Do until action.

Dynamic content not available in Power Automate

Image
Scenario After I added a "Post adaptive card and wait for a response" action the dynamic content of that action was not available to select from. The adaptive card asks for an approval using this code: {    "type": "ActionSet",    "actions": [    {       "type": "Action.Submit",       "title": "Approve",       "id": "Approve"    },    {       "type": "Action.Submit",       "title": "Reject",       "id": "Reject"    }    ] } If you want to know more about adaptive cards and how to format them, go here ! After that the submitActionId was not available in the dynamic content. To find out what dynamic content you need in subsequent actions just test your flow and check the output of the "Post adaptive card and wait for a response" action. To use outcomes from the previous action is manually entered the folowing expression: