I have a requirement to display a table in mail. I have used 'Create HTML Table' activity in logic app and below is the result.
I want to add colors to alternative rows. Something like below.
Is there a way to customise the 'Create HTML table' activity in Logic app to increase the table size and add colors?
You can do this using Logic apps. Use the following steps in the work flow :
Make sure you set the parallelism concurrency in the foreach loop to 1 so it runs sequentially else you will have weird sequence counts.
Your workflow will look like this.
The code version looks like this.
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Create_HTML_table": {
"inputs": {
"format": "HTML",
"from": "@variables('output')"
},
"runAfter": {
"For_each": [
"Succeeded"
]
},
"type": "Table"
},
"For_each": {
"actions": {
"Append_to_output_array": {
"inputs": {
"name": "output",
"value": "@addProperty(items('For_each'),'Sequence',variables('Sequence'))"
},
"runAfter": {
"Increment_Sequence": [
"Succeeded"
]
},
"type": "AppendToArrayVariable"
},
"Increment_Sequence": {
"inputs": {
"name": "Sequence",
"value": 1
},
"runAfter": {},
"type": "IncrementVariable"
}
},
"foreach": "@triggerBody()",
"runAfter": {
"Initialize_Sequence": [
"Succeeded"
]
},
"runtimeConfiguration": {
"concurrency": {
"repetitions": 1
}
},
"type": "Foreach"
},
"Initialize_Sequence": {
"inputs": {
"variables": [
{
"name": "Sequence",
"type": "integer",
"value": 0
}
]
},
"runAfter": {
"Initialize_output": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_output": {
"inputs": {
"variables": [
{
"name": "output",
"type": "array",
"value": []
}
]
},
"runAfter": {},
"type": "InitializeVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"schema": {
"items": {
"properties": {
"File": {
"type": "string"
},
"File availability": {
"type": "string"
}
},
"required": [
"File",
"File availability"
],
"type": "object"
},
"type": "array"
}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}