I am creating new session in below query which name is Create_Session.
let
BaseURL = BaseURLPara,
body = "{""sessionId"":null}",
Source = Json.Document(Web.Contents(BaseURL,
[
RelativePath = "/testAPI/session/create_session",
Content = Text.ToBinary(body),
Headers = [#"Content-Type" = "application/json"]
])),
newSessionID = Source[data][newSessionID]
in
newSessionID
This created SessionId I want to pass in below new Query but when I refresh all then /testAPI/session/create_session call two times in backend.I do not want to call /testAPI/session/create_session in below query because I already pass Sessionid using variable (Createsession) then why /testAPI/session/create_session call in below Query?
let
BaseURL=BaseURLPara,
Createsession=Create_Session,
body="{""sessionId"": """ & Createsession & """,
""isSearch"": false,
""keyword"": """",
""exploreType"": 2}",
Source=Json.Document(Web.Contents(BaseURL,
[
RelativePath="/testAPI/explorer/location_hierarchy",
Content=Text.ToBinary(body),
Headers=[#"Content-Type"="application/json"]
])),
#"Converted to Table" = Record.ToTable(Source),
Value = #"Converted to Table"{1}[Value],
#"Converted to Table1" = Record.ToTable(Value),
Value1 = #"Converted to Table1"{0}[Value],
#"Parsed JSON" = Json.Document(Value1),
#"Converted to Table2" = Record.ToTable(#"Parsed JSON"),
#"Expanded Value" = Table.ExpandListColumn(#"Converted to Table2", "Value"),
#"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"EntID", "EntityName", "Name", "Description", "Type", "Icon", "Room"}, {"EntID", "EntityName", "Name.1", "Description", "Type", "Icon", "Room"}),
#"Expanded Room" = Table.ExpandListColumn(#"Expanded Value1", "Room"),
#"Expanded Room1" = Table.ExpandRecordColumn(#"Expanded Room", "Room", {"EntID", "EntityName", "Name", "Description", "Type", "Icon", "Floor"}, {"EntID.1", "EntityName.1", "Name.2", "Description.1", "Type.1", "Icon.1", "Floor"}),
#"Expanded Floor" = Table.ExpandListColumn(#"Expanded Room1", "Floor"),
#"Expanded Floor1" = Table.ExpandRecordColumn(#"Expanded Floor", "Floor", {"EntID", "EntityName", "Name", "Description", "Type", "Icon", "HasChildren"}, {"EntID.2", "EntityName.2", "Name.3", "Description.2", "Type.2", "Icon.2", "HasChildren"}),
#"Renamed Columns1" = Table.RenameColumns(#"Expanded Floor1",{{"EntID", "Parent ID"}, {"Name.1", "Site Name"}, {"Type", "Room Type"}, {"Name.2", "Room Name"}, {"Name.3", "Floor Name"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns1",{"Description", "Icon", "Description.1", "Icon.1", "Description.2", "Icon.2"})
in
#"Removed Columns"