Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Some instances require a specialized Odata connection with an Advanced Transformation.

Instructions

Copy the script below, updating the Tenant ID and Module Name. (Lines 5 & 13)

let
   EntitiesPerPage = 1000,
 
    GetEntityCount = () =>
        let Json  = Json.Document(Web.Contents("https://core.stratawise.com/odata/350/MA@POU",  [Query=[#"$count"="true"]])),
            Count = Json[#"value"]
        in  Count,
 
    GetPage = (Index) =>
        let Skip  = Text.From(Index * EntitiesPerPage),
        
            Top   = Text.From(EntitiesPerPage),
            Json  =  Json.Document(Web.Contents("https://core.stratawise.com/odata/350/MA@POU", [Query=[#"$skip"=Skip, #"$top"=Top]])),
            Value = Json[#"value"]
        in  Value,
 
    EntityCount = List.Max({ EntitiesPerPage, GetEntityCount() }),
    PageCount   = Number.RoundUp(EntityCount / EntitiesPerPage), //1,
    PageIndices = { 0 .. PageCount - 1 },
    Pages       = List.Transform(PageIndices, each GetPage(_)),
    Entities    = List.Union(Pages),
    Table       = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
    
in
    Table

  1. Connect to through the existing Odata connection provided through the export prompt in the module grid.

  2. Select Transform Data.

  3. Select Advanced Editor.

  4. Paste the updated script from above and select Done.

  5. Select the icon at the top of the data set to expand.

  6. Then OK.

  7. Select Advanced Editor again.

  8. Copy the resulting script to a text editor and replace “column1.“ with ““ (nothing).

  9. Paste the updated script in and validate the resulting columns appear correct.

  • No labels