Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm new to Power BI. But I'm trying to POST a SOAP request which takes input as xml. I have a query (name Headerids) that has a column name xmltaskids. I would like to convert that Column to the below xml String. Please help me how can I convert ALL the records to a single String so that it represents XMLbody
Please note:
Each row in the column --> has XML tag and Value.
e.g. 1st row is <taskId>28161430</taskId> in the column
2nd row is <taskId>27739924</taskId>
body = "<Envelope xmlns=""http://schemas.xmlsoap.org/soap/envelope/"">
<Body>
<readTasks xmlns=""http://mercury.com/ppm/pm/service/1.0"">
<taskId>28161430</taskId>
<taskId>27739924</taskId>
<taskId>27739925</taskId>
<taskId>27739926</taskId>
<taskId>27739927</taskId>
<taskId>28161430</taskId>
</readTasks>
</Body>
</Envelope> ",
There might be other ways of doing this, but used Table.AddColumns to add a column with a constant value of 1. Then I used Table.Group to group all the rows on that value and used Text.Combine to join that xmltaskids column.
eg.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBOLkkszvZMAbNTjSwMzQxNjA0gMvrIUkqxOlh1mJsbW1oamZCsw5RkHWYk6zAnQQc+n8cCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [xmltaskids = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"xmltaskids", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Group", each 1), #"Grouped Rows" = Table.Group(#"Added Custom", {"Group"}, {{"TaskIds", each Text.Combine( [xmltaskids]), type text}}), #"FirstRow" = #"Grouped Rows"{[Group=1]}[TaskIds], body = Text.Combine({"<Envelope xmlns=""http://schemas.xmlsoap.org/soap/envelope/""> <Body> <readTasks xmlns=""http://mercury.com/ppm/pm/service/1.0"">", #"FirstRow", "</readTasks> </Body> </Envelope> "}) in body
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
99 | |
80 | |
77 | |
66 |
User | Count |
---|---|
130 | |
106 | |
105 | |
86 | |
72 |