i have written the expression rule to show the data in table. but how to remove these semicolons from the table
a!localVariables( local!contractData: rule!generatecontracttable( cif_int: ri!cif_int ), local!rowItemsdata: { "<tr> <th class=""left"">" & index( local!contractData.value_txt, wherecontains( 1, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</th> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 5, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 6, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 7, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 9, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 10, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 11, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 12, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 13, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 15, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> <td class=""left"">" & index( local!contractData.value_txt, wherecontains( 16, tointeger( local!contractData.extensionRefId_int ) ), {} ), "</td> </tr>" }, local!rowsSumdata: { "<tr> <th class=""left""> Total </th> <td class=""left""> </td> <td class=""left""> " & sum( index( local!contractData.value_txt, wherecontains( 6, tointeger( local!contractData.extensionRefId_int ) ), {} ) ), " </td> <td class=""left"">" & sum( index( local!contractData.value_txt, wherecontains( 7, tointeger( local!contractData.extensionRefId_int ) ), {} ) ), " </td> <td class=""left""> </td> <td class=""left"">" & sum( index( local!contractData.value_txt, wherecontains( 10, tointeger( local!contractData.extensionRefId_int ) ), {} ) ), " </td> <td class=""left""> </td> <td class=""left""> </td> <td class=""left""> </td> <td class=""left""> </td> <td class=""left""> </td> </tr>" }, "<table id=""contractTabe""> <tr> <th style=""width:10%"">Contract ID</th> <th style=""width:10%"">Contract Limit</th> <th style=""width:10%"">Contract Outstanding</th> <th style=""width:10%"">Value of Extension sought</th> <th style=""width:10%"">Capital Amount </th> <th style=""width:10%"">Interest Amount </th> <th style=""width:10%"">Current Due Date</th> <th style=""width:10%"">Days to be Extended </th> <th style=""width:10%"">New Maturity Date </th> <th style=""width:10%"">Is interest to be recovered</th> <th style=""width:10%"">Account for Interest Recovery</th> </tr>" & local!rowItemsdata & local!rowsSumdata & " </table>" )
this is code is generation the table
Discussion posts and replies are publicly visible
Hi, just use stripwith(...,";") or substitute(...,";","")
For your local!rowItemsdata you create a list of text. Later, this is turned into a single text and Appian adds the default separator ";" between each item. I suggest to use the joinarray() function which allows you to define the separator, which can also be a space or an empty string.
Unknown said:I suggest to use the joinarray() function
Another nice trick when using an expression rule to generate HTML code like this, is to use a char(10) separator in appropriate places as that creates linebreaks in the generated code (making it easier to read), which is then of course ignored by the HTML interpreter and should thus not affect the eventual rendered HTML table in this case.
Gabriele Camilli said:use stripwith(...,";") or substitute(...,";","")
Sorry, but I would strongly disagree with this approach.
The implication here is that this substitution would need to be run against the result of a flattened array of HTML code containing arbitrary user-facing plaintext. That plaintext might contain ";" characters that actually belong there, and this would mess those up, among other potential issues. The proper way to handle resolving an array into plaintext to get the desired output is, as Stefan already suggested, to handle the array itself - like with joinArray() (among certain other possibilities).