Hi all ,
I have to generate a table with the help of html . Is there any way to create . Please let me know know the ways
Discussion posts and replies are publicly visible
Hi Saurabh.
I don't think there is any direct way to render HTML on Appian.
Then how can I achieve this . Let me know
Can you paste that HTML here so I can take a look?
a!localVariables( local!data:rule!T_createDictionary(final: null), local!titles:{"Name","Age"}, local!startTable:"<table>", local!closeTable:"</table>", local!startRowtitle:"<td>", local!closeRowtitle:"</td>", local!startRowitemTitle:"<tr>", local!closeRowItemTitle:"</tr>", local!startRow:"<tr>", local!closeRow:"/tr>", local!startItemRow:"<td>", local!closeItemrow:"</td>", local!output: { local!startTable & local!startRow & joinarray( a!forEach( items: local!titles, expression: { local!startRowtitle & fv!item & local!closeRowtitle } ), "" ) & local!closeRow & joinarray( a!forEach( items: local!data, expression: /*items with data*/ local!startRow & local!startItemRow & " " & index( fv!item, "name", null ) & local!closeItemrow ) ) }, local!output )
I have to send a message in google chat . i have working Google integration to send message . just I want to create a message with SNO || Date || links
When you already have data in your local variables, then why do you want to convert it in HTML first and then render the HTML on Interface?
As I mentioned above I have to send a message via Google chat . So want it to in a proper format
Hi Saurabh,
if your requirement is to send the request body in HTML text with only 3 columns and your current expression rule also provides the HTML table.
Here's a code snippet where you can remove some un-necessary variables, hope it helps.
a!localVariables( local!data: { { date: today(), link: { href: "https://www.google.com", value: "Google" } }, { date: today() - 4, link: { href: "https://community.appian.com", value: "Community" } }, { date: today() + 3, link: { href: "", value: "Appian" } } }, joinarray( { "<table>", "<tr><th>S.No.</th><th>Date</th><th>Links</th></tr>", a!forEach( items: local!data, expression: concat( "<tr>", "<td>" & fv!index & "</td>", "<td>" & text(fv!item.date, "mmm dd yyyy") & "</td>", "<td> <a href='" & a!defaultValue(fv!item.link.href, "#") & "'>" & fv!item.link.value & "</a>", "</td>", "</tr>" ) ), "</table>" }, char(10) ) )
The above code displays as below on a browser
Hi agam , thanks for replying will this grid will work in Google chat . Means I have to send a message in Google chat
It depends on how the Google API is expecting the request format to be
You can try / check in their documentation