Forum Discussion
Dataflow Gen2 - Getting source name
- 1 year ago
Hi tcollett0
To achieve this, define a variable to store the source name string before navigation steps, and then add it as a custom column after loading the target table. Adjust existing code as follows:
let
Source = Dynamics365BusinessCentral.ApiContentsWithOptions("CityWide-UAT", null, null, [UseReadOnlyReplica = true, AcceptLanguage = null, Timeout = null, ODataMaxPageSize = null]),
SourceName = "Central Kentucky",
Navigation1 = try Source{[Name = SourceName]}[Data] otherwise error "Source '" & SourceName & "' not found",
Navigation2 = try Navigation1{[Name = "WebServices"]}[Data] otherwise error "WebServices not found",
Navigation3 = try Navigation2{[Name = "CW_G_L_Entries", Signature = "table"]}[Data] otherwise error "CW_G_L_Entries not found",
AddSourceColumn = Table.AddColumn(Navigation3, "Source_Location", each SourceName, type text)
in
AddSourceColumn
This ensures that each row in your final result will carry the correct source name without hardcoding it multiple times.
If this post helps, kindly mark it Accepted Solution. It will helps others to find more easily.
Thank You!
Hi tcollett0
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.