Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Creating Template for AzureDevOps connector

Hello All,

 

I am practicing to create a template using AzureDevOps connector. 

If you have noticed When you select AzureDevOps connector as your data source it shows below prompt. 

 

After adding correct values, it goes to next screen and pulls the data upon providing Devops account credentials. 

 

My Question is: 

I dont see any option to parameterized this connector. 

How do I parameterized above prompt so that when other team opens a template file, they will be asked to put Organization name and Team Project name and then credentials on next screen?

 

Your help is appriciated. Thanks  

  • I think it is possible to parameterize those values, however it won't do you any good I am afraid. To parameterize, go to the Power Query Editor, click on "Manage Parameters" and add two text parameters for Organisation and for Project. Then, in the advanced editor, you see this line:

    = VSTS.AnalyticsViews("orgName", "MyFirstProject", [])

    Now, you can replace "orgName" with the parameter name you just created for Organisation and "MyFirstProject" with the parameter name you just created for Project, like this (in my case, the params are called Org and Project):

    However, notice the tablenames that I imported in this example. These are unique to your organisation and project. Even if you change the project name alone, your query would fail as the extracted table simply doesn't exist. 

    Sorry to be the bearer of bad news 😞

     

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Keep those thumbs up coming! 🙂

     

3 Replies

  • JarroVGIT's avatar
    JarroVGIT
    Icon for Resident Rockstar rankResident Rockstar

    I think it is possible to parameterize those values, however it won't do you any good I am afraid. To parameterize, go to the Power Query Editor, click on "Manage Parameters" and add two text parameters for Organisation and for Project. Then, in the advanced editor, you see this line:

    = VSTS.AnalyticsViews("orgName", "MyFirstProject", [])

    Now, you can replace "orgName" with the parameter name you just created for Organisation and "MyFirstProject" with the parameter name you just created for Project, like this (in my case, the params are called Org and Project):

    However, notice the tablenames that I imported in this example. These are unique to your organisation and project. Even if you change the project name alone, your query would fail as the extracted table simply doesn't exist. 

    Sorry to be the bearer of bad news 😞

     

    Kind regards

    Djerro123

    -------------------------------

    If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

    Keep those thumbs up coming! 🙂

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      JarroVGITThanks for your reply.

       

      I was familiar with usage of parameters but could not find that dropdown to choose parameter on UI as shown below: 

       

      but looks like it will work if I put parametes name in M code itself. 

       

      If that works then I might have a solution for the problem you mentioned. Have a look below and let me know if it makes sense. 

       

      so we parameterized the 2 variables right. and now if you know which query name and which folder you are importing from then it will be easier for it to understand. 

      something shown as below. 

       

      let
      Source = VSTS.AnalyticsViews(OrganizationName, TeamProject, []),
      #"AllWorkItems" = #"Source"{[Name="AllWorkItems",Kind="Table"]}[Data], 

       

      so here OrganizationName, TeamProject are parameters.

       

      I am putting Source as query Name I want instead of Id. 

      As long as name for this query we are pulilng is same name it will work based on its name instead of Id (because Id will be different as you mentioned.)

       

      Thanks. 

       

       

      • JarroVGIT's avatar
        JarroVGIT
        Icon for Resident Rockstar rankResident Rockstar

        That might, I haven't tried that but if it works that is great 🙂 Don't forget to mark my post as the solution for your Parameter question though 🙂

         

        Kind regards

        Djerro123

        -------------------------------

        If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

        Keep those thumbs up coming! 🙂