For Zoho Services only:


I'm actually part of a bigger team at Ascent Business Solutions where we have support technicians and project consultants. Support is for smaller technical fixes but this can include developments, reports or integrations; depending on the size of the task. Projects are for more time-consuming developments such as revamps of the Zoho Suite of apps or on-site training. The advantage of a team is that if I am out-of-office for a day or so, there is always someone at Ascent Business Solutions who can deal with any queries/issues you may have.

Our support rates can be found and purchased at http://ascentbusiness.co.uk/zoho-support-2. A support bundle doesn't have an expiry date. So whether we can do what you want within the bundle and a year later need further support, if there are minutes left on the bundle then there is no additional charge.

Our project rates for bigger developments can be found at http://ascentbusiness.co.uk/crm-solutions/zoho-crm-packages-prices and will involve a dedicated project consultant along with developers who will hold your hand through the development process.

If you want help building a solution for one of the Zoho Apps in the Zoho Suite, contact us on 0121 392 8140 (UK) or by email at info@ascentbusiness.co.uk. You can also visit our website at http://ascentbusiness.co.uk.

I regularly build and specialize in 2-way API integrations for Xero, Shopify and eBay.

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 :: Article: 801

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: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used 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

Related Articles

Joes Revolver Map

Joes Word Cloud

happen   stringtodecode   htmlentitynames   string   entities   replace   decodehtmlentities   usage   datacleansing   entity   wouldn   output   info   keys   comprehensive   exceptions   entityindex   called   namespace   code   htmlentity   build   encryption   call   list   father   thisapp   htmlentitychars   apos   teststring   note   index   yields   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   tolist   quotes   return   creator   loop   whatever   sons   function   would   deluge   decoder   decodedstring   html   zoho   htmlkey   convert   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

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 - Valid till 8 May 2022 bc1qjtp4l4ra452wzvuk9a45yfj82zkahsyy2z379y
© 2022 Joel Lipman .com. All Rights Reserved.