Jump to content

Adding static text before a field


rpaterick

Recommended Posts

Trying to get Cell Phone before the field Cell Phone.

When it has value, it should look like Cell Phone XXX-XXX-XXXX

When no value, just blank.

 

Code I have now which is wrong.

 

if (Field("Cell Phone") == "") {
  return "";
  }
else return Field("Cell Phone") + "Cell Phone " ;

 

Thanks,:D

Ryan

Link to comment
Share on other sites

Ryan,

 

If there is only one variable on the line you actually do not need a rule to manage this. Instead, open the frame in the variable text editor window, highlight the line 'Cell: xxx-xxx-xxxx', click the Paragraph button and select suppress 'if containing empty variable' option.

 

This should do the trick!

Link to comment
Share on other sites

Ryan,

 

If there is only one variable on the line you actually do not need a rule to manage this. Instead, open the frame in the variable text editor window, highlight the line 'Cell: xxx-xxx-xxxx', click the Paragraph button and select suppress 'if containing empty variable' option.

 

This should do the trick!

 

 

I think this will do! Thanks! I was thinking it had to be CODE.

Link to comment
Share on other sites

  • 1 year later...

I have a line that looks like this:

«Change phone format Rule_Contact» • «Website»

 

I need to suppress the bullet if the website is empty. I tried what this thread suggests, but it's not working?

 

It keeps suppressing the whole entire line? I try and select the bullet and website only, but it checks the entire line including the "Change Phone Format"????

 

Any ideas what I can do to suppress just the bullet and website? :confused:

 

I have Fusion Pro 7.0p1d, Vista format (yuck) & Abode Pro 9.0

Link to comment
Share on other sites

I have a line that looks like this:

«Change phone format Rule_Contact» • «Website»

 

I need to suppress the bullet if the website is empty. I tried what this thread suggests, but it's not working?

 

It keeps suppressing the whole entire line? I try and select the bullet and website only, but it checks the entire line including the "Change Phone Format"????

 

Any ideas what I can do to suppress just the bullet and website?

If the line has something other than a single label and field, you can't use the "Suppress if containing empty variables" setting. You have to write a rule. It's very simple logic though:

if (Field("Website"))
   return "• " + NormalizeEntities(Field("Website"));
//else
return "";

Make sure to check "Treat returned strings as tagged text."

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...