For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho Deluge: a HTML Entity Decoder

Zoho Deluge: a HTML Entity Decoder

What?
A very quick article to document a HTML Entity decoder in Zoho Creator.

Why?
Sometimes when receiving data from a third-party, we may receive some strings containing "&" or " " and obviously want to display these as decoded HTML entities. (Zoho if you're listening) Ideally, Zoho may add this to their zoho.encryption namespace such as zoho.encryption.htmldecode(string). But at time of print, it doesn't exist and in the meantime, I've made a function that does this.

How?
Not sure how else to do this but I simply wrote a function in Zoho Creator for each instance that I knew a HTML entity would be submitted. So it doesn't decode every HTML in existence, only the ones I know will happen.

Here's the Zoho Deluge code I use (note that I've put this in a namespace called "DataCleansing", but you can call it whatever you like):
copyraw
string DataCleansing.fn_DecodeHtmlEntities( string p_StringToDecode )
{
	// initialize
	v_StringToDecode = ifnull(p_StringToDecode,"");
	//
	// map string replacements
	m_HtmlEntity = Map();
	m_HtmlEntity.put("&","&");
	m_HtmlEntity.put(" "," ");
	//
	// loop through each of the above replacing where found
	for each  v_HtmlKey in m_HtmlEntity.keys()
	{
		v_StringToDecode = v_StringToDecode.replaceAll(v_HtmlKey, m_HtmlEntity.get(v_HtmlKey), true);
	}
	// 
	// output
	return v_StringToDecode;
}
  1.  string DataCleansing.fn_DecodeHtmlEntities( string p_StringToDecode ) 
  2.  { 
  3.      // initialize 
  4.      v_StringToDecode = ifnull(p_StringToDecode,"")
  5.      // 
  6.      // map string replacements 
  7.      m_HtmlEntity = Map()
  8.      m_HtmlEntity.put("&","&")
  9.      m_HtmlEntity.put(" "," ")
  10.      // 
  11.      // loop through each of the above replacing where found 
  12.      for each  v_HtmlKey in m_HtmlEntity.keys() 
  13.      { 
  14.          v_StringToDecode = v_StringToDecode.replaceAll(v_HtmlKey, m_HtmlEntity.get(v_HtmlKey), true)
  15.      } 
  16.      // 
  17.      // output 
  18.      return v_StringToDecode; 
  19.  } 

Usage:
copyraw
v_TestString = "Father & Sons";
v_DecodedString = thisapp.DataCleansing.fn_DecodeHtmlEntities(v_TestString);
info v_DecodedString;

// yields: Father & Sons
  1.  v_TestString = "Father & Sons"
  2.  v_DecodedString = thisapp.DataCleansing.fn_DecodeHtmlEntities(v_TestString)
  3.  info v_DecodedString; 
  4.   
  5.  // yields: Father & Sons 

A more comprehensive list
copyraw
v_HtmlEntityNames = "amp,lt,gt,nbsp,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,times,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,divide,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml,fnof,circ,tilde,Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,bull,hellip,permil,prime,Prime,lsaquo,rsaquo,oline,frasl,euro,image,weierp,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams";
v_HtmlEntityChars = "&,<,>, ,¡,¢,£,¤,¥,¦,§,¨,©,ª,«,¬,­,®,¯,°,±,²,³,´,µ,¶,·,¸,¹,º,»,¼,½,¾,¿,À,Á,Â,Ã,Ä,Å,Æ,Ç,È,É,Ê,Ë,Ì,Í,Î,Ï,Ð,Ñ,Ò,Ó,Ô,Õ,Ö,×,Ø,Ù,Ú,Û,Ü,Ý,Þ,ß,à,á,â,ã,ä,å,æ,ç,è,é,ê,ë,ì,í,î,ï,ð,ñ,ò,ó,ô,õ,ö,÷,ø,ù,ú,û,ü,ý,þ,ÿ,Œ,œ,Š,š,Ÿ,ƒ,ˆ,˜,Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,ς,σ,τ,υ,φ,χ,ψ,ω,ϑ,ϒ,ϖ, , , ,‌,‍,‎,‏,–,—,‘,’,‚,“,”,„,†,‡,•,…,‰,′,″,‹,›,‾,⁄,€,ℑ,℘,ℜ,™,ℵ,←,↑,→,↓,↔,↵,⇐,⇑,⇒,⇓,⇔,∀,∂,∃,∅,∇,∈,∉,∋,∏,∑,−,∗,√,∝,∞,∠,∧,∨,∩,∪,∫,∴,∼,≅,≈,≠,≡,≤,≥,⊂,⊃,⊄,⊆,⊇,⊕,⊗,⊥,⋅,⌈,⌉,⌊,⌋,⟨,⟩,◊,♠,♣,♥,♦";
l_HtmlEntityNames = v_HtmlEntityNames.toList();
l_HtmlEntityChars = v_HtmlEntityChars.toList();
//
// add these exceptions (quotes) which wouldn't convert to a list
l_HtmlEntityNames.add("quo");
l_HtmlEntityNames.add("apos");
l_HtmlEntityChars.add("\"");
l_HtmlEntityChars.add("'");
//
// build a map
m_HtmlEntity = Map();
for each index v_EntityIndex in l_HtmlEntityNames
{
	m_HtmlEntity.put("&" + l_HtmlEntityNames.get(v_EntityIndex) + ";", l_HtmlEntityChars.get(v_EntityIndex));
}
//
// loop through list of entities to replace each one in our string
for each  v_HtmlKey in m_HtmlEntity.keys() 
{ 
	v_Test = v_Test.replaceAll(v_HtmlKey, m_HtmlEntity.get(v_HtmlKey), true); 
} 
info v_Test;
// yields: Father & Sons
  1.  v_HtmlEntityNames = "amp,lt,gt,nbsp,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,times,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,divide,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml,fnof,circ,tilde,Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,bull,hellip,permil,prime,Prime,lsaquo,rsaquo,oline,frasl,euro,image,weierp,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams"
  2.  v_HtmlEntityChars = "&,<,>, ,¡,¢,£,¤,¥,¦,§,¨,©,ª,«,¬,­,®,¯,°,±,²,³,´,µ,,·,¸,¹,º,»,¼,½,¾,¿,À,Á,Â,Ã,Ä,Å,Æ,Ç,È,É,Ê,Ë,Ì,Í,Î,Ï,Ð,Ñ,Ò,Ó,Ô,Õ,Ö,×,Ø,Ù,Ú,Û,Ü,Ý,Þ,ß,à,á,â,ã,ä,å,æ,ç,è,é,ê,ë,ì,í,î,ï,ð,ñ,ò,ó,ô,õ,ö,÷,ø,ù,ú,û,ü,ý,þ,ÿ,Œ,œ,Š,š,Ÿ,ƒ,ˆ,˜,Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,ς,σ,τ,υ,φ,χ,ψ,ω,ϑ,ϒ,ϖ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,♦"
  3.  l_HtmlEntityNames = v_HtmlEntityNames.toList()
  4.  l_HtmlEntityChars = v_HtmlEntityChars.toList()
  5.  // 
  6.  // add these exceptions (quotes) which wouldn't convert to a list 
  7.  l_HtmlEntityNames.add("quo")
  8.  l_HtmlEntityNames.add("apos")
  9.  l_HtmlEntityChars.add("\"")
  10.  l_HtmlEntityChars.add("'")
  11.  // 
  12.  // build a map 
  13.  m_HtmlEntity = Map()
  14.  for each index v_EntityIndex in l_HtmlEntityNames 
  15.  { 
  16.      m_HtmlEntity.put("&" + l_HtmlEntityNames.get(v_EntityIndex) + ";", l_HtmlEntityChars.get(v_EntityIndex))
  17.  } 
  18.  // 
  19.  // loop through list of entities to replace each one in our string 
  20.  for each  v_HtmlKey in m_HtmlEntity.keys() 
  21.  { 
  22.      v_Test = v_Test.replaceAll(v_HtmlKey, m_HtmlEntity.get(v_HtmlKey), true)
  23.  } 
  24.  info v_Test; 
  25.  // yields: Father & Sons 
Category: Zoho Deluge :: Article: 336

Accreditation

Badge - Zoho Creator Certified Developer Associate
Badge - Zoho Deluge Certified Developer
Badge - Certified Zoho CRM Developer

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com