Forum Discussion

thyjones's avatar
thyjones
Helper I
5 years ago

Getting web contents based on dynamic information

Hi All,

 

Struggling a bit with this one. So, I have an online spreadsheet which is now within BI as a table (Score), with 3 columns:

ID, Title, URL

 

The id is an id of a custom api, title is exactly that and the URL is the custom link to the specific api link (which basically returns a figure, such as 55.

 

Is there any way I can use this information to pull web contents dynamically? I've seen you can add parameters but I can't seem to specify anything dynamically here.

 

If i manually set this up with web contents and use the URL, it works fine and returns the number, but each month there will be new ones I wish to add.

 

Thanks

6 Replies

  • thyjones 

    Can you share the M Code that connects to the file?

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

    • thyjones's avatar
      thyjones
      Helper I

      Hi Fowmy, yes its:

       

      let
      Source = Excel.Workbook(Web.Contents("https://customlink/Documents/file.xlsx"), null, true),
      Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
      #"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type text}, {"Column2", type text}}),
      #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "ID"}, {"Column2", "Title"}}),
      #"Promoted Headers" = Table.PromoteHeaders(#"Renamed Columns", [PromoteAllScalars=true]),
      #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"ID", Int64.Type}, {"Title of NPS Visual", type text}, {"URL", type text}})
      in
      #"Changed Type1"

      • Fowmy's avatar
        Fowmy
        Super User

        thyjones 

        Which part of the query do you need to make dynamic?
        Provide an example, please?

        ________________________

        If my answer was helpful, please consider Accept it as the solution to help the other members find it

        Click on the Thumbs-Up icon if you like this reply 🙂

        YouTube  LinkedIn

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi  thyjones  ,

     

    Do the suggestions from engineers make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

     

    Best regards

    Amy