I am trying to create a output liek this
the approach I have tied to create table
the output I have now,
No I want to insert the new child html below content after each employee row ,I mean last row
range(0, length(sort(outputs('Compose'), 'Name')))
if(
or(
equals(item(), 0),
not(
equals(
sort(outputs('Compose'), 'Name')[sub(item(), 1)].Name,
sort(outputs('Compose'), 'Name')[item()].Name
)
)
),
concat(
'<tr class="namerow"><td rowspan="',
length(
xpath(
xml(json(concat('{"Root":{"Item":',outputs('Compose'),'}}'))),
concat('//Item[Name="',sort(outputs('Compose'), 'Name')[item()].Name,'"]')
)
),
'">',
sort(outputs('Compose'), 'Name')[item()].Name,
'</td><td>',
sort(outputs('Compose'), 'Name')[item()].Value0,
'</td><td>',
sort(outputs('Compose'), 'Name')[item()].Value1,
'</td></tr>'
),
concat(
'<tr><td>',
sort(outputs('Compose'), 'Name')[item()].Value0,
'</td><td>',
sort(outputs('Compose'), 'Name')[item()].Value1,
'</td></tr>'
)
)
join(body('Select_2'), '')
sort(outputs('Compose'), 'Name')
range(0, length(split(body('Create_HTML_table'), '<tr>')))
if(
less(item(), 2),
split(body('Create_HTML_table'), '<tr>')[item()],
if(
startswith(
split(body('Create_HTML_table'), '<tr>')[sub(item(), 1)],
slice(
split(body('Create_HTML_table'), '<tr>')[item()],
0,
add(
indexOf(
split(body('Create_HTML_table'), '<tr>')[item()],
'</td>'
),
5
)
)
),
slice(
split(body('Create_HTML_table'), '<tr>')[item()],
add(
indexOf(
split(body('Create_HTML_table'), '<tr>')[item()],
'</td>'
),
5
)
),
concat(
'<td rowspan="',
length(
xpath(
xml(json(concat('{"Root":{"Item":',outputs('Compose'),'}}'))),
concat('//Item[Name="',
slice(
split(body('Create_HTML_table'), '<tr>')[item()],
4,
indexOf(
split(body('Create_HTML_table'), '<tr>')[item()],
'</td>'
)
),
'"]')
)
),
'">',
slice(
split(body('Create_HTML_table'), '<tr>')[item()],
4
)
)
)
)
replace(
join(body('Select'), '<tr>'),
'<tr><td rowspan',
'<tr class="namerow"><td rowspan'
)
[
{"Name":"Jim", "Value0": 0, "Value1": 1},
{"Name":"John", "Value0": 0, "Value1": 0},
{"Name":"Jim", "Value0": 10, "Value1": 11},
{"Name":"Jane", "Value0": 0, "Value1": 1},
{"Name":"Jane", "Value0": 10, "Value1": 11},
{"Name":"Jim", "Value0": 20, "Value1": 21}
]
union(
xpath(
xml(json(concat('{"Root":{"Item":',outputs('Compose'),'}}'))),
'//Item/Name/text()'
),
json('[]')
)
concat(
replace(
slice(
variables('htmlTable'),
0,
nthIndexOf(
variables('htmlTable'),
concat('<tr><td>',items('Apply_to_each'),'</td>'),
2
)
),
concat('<tr><td>',items('Apply_to_each'),'</td>'),
concat('<tr class="namerow"><td rowspan="',
length(
xpath(
xml(json(concat('{"Root":{"Item":',outputs('Compose'),'}}'))),
concat('//Item[Name="',items('Apply_to_each'),'"]')
)
),
'">',items('Apply_to_each'),'</td>')
),
replace(
slice(
variables('htmlTable'),
nthIndexOf(
variables('htmlTable'),
concat('<tr><td>',items('Apply_to_each'),'</td>'),
2
)
),
concat('<tr><td>',items('Apply_to_each'),'</td>'),
'<tr>'
)
)