Skip to content

Commit be474ec

Browse files
authored
Merge branch 'main' into Milindav-FnO-data-inSynapse-Link
2 parents 69be50a + 7e88a2d commit be474ec

File tree

2 files changed

+39
-8
lines changed

2 files changed

+39
-8
lines changed

powerapps-docs/maker/canvas-apps/connections/azure-devops.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ Power Apps connector for [Azure DevOps](/connectors/visualstudioteamservices/) a
2222
> [!TIP]
2323
> For a complete list of all actions, see [Azure DevOps connector actions](/connectors/visualstudioteamservices/#actions).
2424
25-
In this article, you'll create a canvas app that connects to Azure DevOps to retrieve the list of queries, and work with work items within the project.
25+
The objective of this article is to guide you in building a canvas app that can connect with Azure DevOps to gather a list of queries and interact with the work items in the project.
2626

2727
## Prerequisites
2828

29-
- You need a Power Apps license. If you don't have a license, use a [30-day trial](../../signup-for-powerapps.md), or sign up for a [developer plan](../../developer-plan.md) for non-production use.
29+
The following requirements are necessary:
30+
31+
- A Power Apps license. If you don't have a license, use a [30-day trial](../../signup-for-powerapps.md), or sign up for a [developer plan](../../developer-plan.md) for non-production use.
3032
- If you're new to Power Apps, familiarize yourself with Power Apps basics by [generating an app](../get-started-test-drive.md) and then customizing that app's [controls](../add-configure-controls.md), [gallery](../add-gallery.md), [forms](../working-with-forms.md), and [cards](../working-with-cards.md).
31-
- You need a [blank canvas app](../create-blank-app.md) to use to connect to Azure DevOps.
32-
- You need an [Azure DevOps](/azure/devops/user-guide/what-is-azure-devops) instance that has an organization, a project, and a shared query that has few sample work items to edit using the app that you'll create in this article.
33-
- The Azure DevOps instance that must be enabled for **Third-party application access via OAuth**. To configure this setting, see [Manage access policies for Azure DevOps](/azure/devops/organizations/accounts/change-application-access-policies#manage-a-policy).
33+
- A [blank canvas app](../create-blank-app.md) to use to connect to Azure DevOps.
34+
- To create the app featured in this article, you'll require an [Azure DevOps](/azure/devops/user-guide/what-is-azure-devops) instance that includes an organization, a project, and a shared query with a few sample work items available for editing.
35+
- The Azure DevOps instance must be enabled for **Third-party application access via OAuth**. For more information, see [Manage access policies for Azure DevOps](/azure/devops/organizations/accounts/change-application-access-policies#manage-a-policy).
3436

3537
## Step 1 - Add Azure DevOps data source
3638

@@ -163,18 +165,37 @@ So far we have been using the Edit form which simplifies the data access story b
163165
```powerapps-dot
164166
AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id',Organization, Project, Gallery2.Selected.Value.'System.WorkItemType')
165167
```
166-
Note that "WorkItemType" is a text property passed in (e.g., "Feature") that allows you to pivot from items like Features and Work Items. The set of fields for these items vary from each other - which is why the return type from this call is dynamic.
168+
When you pass the text property "WorkItemType", for instance, "Feature", it allows you to switch from items such as Features and Work Items. Since the set of fields for these items differ from one another, the return type from this call is dynamic.
169+
170+
You can access specific values using the common method Text(ThisItem.Value.'System.Id'). Alternatively, you may access them through the more general dynamic response using Text(ThisItem.fields.System_Id). These dynamic value names are not typically documented. To find the correct names for these fields, including non-standard fields, open the monitor tool and examine the data response for the GetWorkItemDetails call. Refer to the image below for further guidance.
167171

168-
To access specific values you can still access the common values the same way (e.g.,`Text(ThisItem.Value.'System.Id')` ). However, you may also access them in the more general dynamic response this way: `Text(ThisItem.fields.System_Id)`. These dynamic values names aren't generally documented. The easiest way to see the correct names for these fields - including the non-standard fields is to open the monitor tool and look at the data response. In this case, to the `GetWorkItemDetails` call. (See image below.)
172+
If you're not utilizing an Edit form, but instead using a container, then you can retrieve these values by using a formula such as the one below, which retrieves information from a custom team field.
169173

170-
If you aren't using an Edit form, but rather simply a container, then you can access these values with a formula like the following: (Which accesses a custom team field.)
171174

172175
```powerapps-dot
173176
Text(AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id',Organization, Project, Gallery2.Selected.Value.'System.WorkItemType').fields.One_custom_CustomField1)
174177
```
175178

176179
> [!div class="mx-imgBorder"]
177180
> ![Text input control that refers to title of the work item.](./media/azure-devops/monitor-workitem-details.png "Text input control referring to title of the work item.")
181+
>
182+
>
183+
## Updating values in Azure DevOps
184+
185+
To update a value in Azure Dev ops use the UpdateWorkItem in the OnSelect of a button.
186+
187+
```powerapps-dot
188+
AzureDevOps.UpdateWorkItem(
189+
Gallery2.Selected.Value.'System.Id',
190+
Organization,
191+
{ description: "This is a new description",
192+
dynamicFields: ParseJSON(JSON({'Custom Field 1': "This is new custom text" }))
193+
}
194+
);
195+
```
196+
The formula adds new sample text but you can also use a PowerFx expression.
197+
198+
Ensure that the formula uses lower case for the *non-custom* or built-in field names. For example, when referring to "Description" field, use `description: "This is a new description"` instead of `Description:"This is a new description"`. Incorrect casing might result in the error "400 Required parameter missing for requested operation: 'UpdateWorkItem'". For custom / dynamic values, you can use the normal casing of display field. For instance the field name for the custom field is just the display name 'Custom Field 1'. This naming convention of the return values is specific to Azure DevOps and may differ from other services.
178199

179200

180201
## Next steps
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
author: ReneeW-CPub
3+
ms.author: renwe
4+
ms.date: 09/22/2023
5+
ms.topic: include
6+
ms.prod: azure
7+
---
8+
9+
> [!NOTE]
10+
> Azure Active Directory is now Microsoft Entra ID. [Learn more](https://learn.microsoft.com/azure/active-directory/fundamentals/new-name)

0 commit comments

Comments
 (0)