ID eq '@{split(triggerOutputs()?['body/title'], 'Task ID:')[1]}'
This issue is likely caused by a mismatch in how the Task ID is being extracted, stored, or compared between the Planner task and the SharePoint list item. Let’s break it down and ensure the logic works as intended.
Action: Create a Task in Planner
Task ID
from the SharePoint list in the format you’re expecting, e.g., "Task Title:123"
where 123
is the list item ID.Action: Store Task ID in SharePoint
Task ID
in a separate SharePoint column (e.g., PlannerTaskID
) rather than relying solely on the title.Trigger: Task Marked as Complete in Planner
Action: Get Tasks List
Extract Task ID
:
) from the task title:
outputs('Get_Task_Title')
with the dynamic content for the task title.Action: Retrieve SharePoint List Items
Condition: Compare IDs
Task ID
with the corresponding SharePoint field.
substring(outputs('Get_Task_Title'), ...)
SharePoint List ID
Trim Whitespaces
Ensure there are no extra spaces around the Task ID
. Use the trim()
function to clean up the strings:
Check for Case-Sensitivity
String comparisons in Power Automate are case-sensitive. Use the equals()
function for comparisons:
Use Logging for Debugging
Add Compose actions before the condition to log the extracted Task ID
and the SharePoint ID
for debugging. This will help identify mismatches.
Store Task ID Explicitly
Instead of embedding the Task ID
in the title, store it in a dedicated Planner task field or the SharePoint list to simplify the comparison logic.
Task ID
.Task ID
is extracted correctly and matches the format of the SharePoint ID.