Hi all,
I am using the Planner connector in Powerapps. I can create a task and add a priority level (with CreateTask), but now I'm looking for a way to retrieve this priority level and display it in my gallery.
Can anyone help please?
Thanks!
Same problem here: there seems to be no way to retrieve the priority of an existing task at the moment. @cha_cha : the ListTaskV3 returns an array of GetTask_Response_V2 objects, which unfortunatelly does not contain a priority. Let me rephrase that: the raw output of ListTaskV3 does contain the priority, but there is no 'priority' property in the return object :-|.
Anyone found a solution (or workaround) to get the priority of an existing planner task?
Hello @fleur2
I just checked the documentation (https://learn.microsoft.com/en-us/connectors/planner/#gettaskdetails_response) for the power apps Planner connector and this might be something you'll have to check on your end. Currently, there are only two namespaces that have priority included in its response.
(1) GetTaskV3
Unfortunately, this namespace is not yet available for the PowerApp Planner connector
(2) ListTasksV3
This requires groupId but it says in the documentation that it returns a priority value. This is untested on my end as I don't have tasks under a group.
Hi @cha_cha ,
Thanks for your reply. I used the switch function to add the priority, for which I used the following formula:
Planner.CreateTaskV4(dropdown.selcted.id, dropdown2.selected.id, txtAddTitle.text, {priority: Switch(dropdown3.Selected.Value, 1, 0, 2, 3, 3, 5, 4, 8)}). In my gallery, I created a list with my tasks using the Planner.ListTasksV2 function. However, this does not include the priority levels, so I am wondering where to retrieve this priority level as set with the Planner.CreateTask function.
Thanks in advance!
Hello @fleur2
You might need to use this reference table to convert priority values.
Full documentation here: https://learn.microsoft.com/en-us/graph/api/resources/plannertask?view=graph-rest-1.0
Priority returned by Planner is usually in integer format. You just have to convert it manually. For example, you can a Label control and its Text value, you can add the following code:
Switch(
ThisItem.Priority,
0, "Urgent",
1, "Urgent",
2, "Important",
3, "Important",
4, "Important",
5, "Medium",
6, "Medium",
7, "Medium",
8, "Low",
9, "Low",
10, "Low",
"Unknown"
)