hide fields in Office 365 signature if there are empty

Copper Contributor

Hello all,

 

I am using dynamically attached signature in Office 365 though a rule, where I append the disclaimer.

But not all users have phone numbers filled in.

Si signature looks like this:

First name, last name

Direct Phone:

Mobile:

Address: complete address

website

 

The script looks like this:

 

aaaa.PNG

 

 

Is there a way to detect if the user does not have a phone entered, that the phone field is skipped entirely? 

So instead of showing Phone: ,  do not show this at all if there is no phone number there.

 

Thank you  

9 Replies

You can use %% variable attributes. This is a snippet of mine:
<span><b>E:</b> %%email%%</span><br/>
<span class="ddi" data-hide="%%PhoneNumber%%"><b>DDI:</b> %%PhoneNumber%%</span><br/>

In your case, variables you can use are as follows:
%%displayname%%
%%PhoneNumber%%
%%title%%</br>
%%company%%
%%street%%
%%city%%, %%state%% %%zipcode%%

@Rhys Williams 

Hello Rhys

Thank you for the update.

Yes, I can use that but the issue is that for example  in this case all elements will be inserted in the disclaimer, all 5 of them, even though let's say the user does not have a company phone, therefor no phine number. In this case, I need to make it not display the phone field.

%%displayname%%
%%PhoneNumber%%
%%title%%</br>
%%company%%
%%street%%
%%city%%, %%state%% %%zipcode%%

 

@Ion-vlad Orascu 

 

Add this part into the html element as below:
<span class="ddi" data-hide="%%PhoneNumber%%"><b>DDI:</b>

 

Anything inside the <span> that reflects what is in the data-hide attribute will be hidden

You cannot have such granularity with the built-in functionality, it's very limited. You're better off looking for third-party tools that specialize in signature management.

@Vasil Michev 

 

Thank you

 

What the other person said might work for single users, but I can't create transport rules to add disclaimers for each individual person, I have hundreds of users 

I have managed to configure around 20 disclaimer rules configured to apply based on a user's group membership. We have 15,000 users who all need signatures and this method works, what're you seeing?

@Rhys Williams 

 

Hi Rhys

 

I am facing this issue, not all have company phones. So those who do not have an empty field in the signature, this looks bad for people.  Creating a special group for these persons seems like a plan, I'll give it some thoughts. To create a group for those who do not have phones. 

 

Many thanks 

You could do the data-hide item i specified above however just not label it with "Telephone:" so effectively it is just their number on its own in the signature and if it doesnt exist it'll just show as white space?

Ideally what you want is an "if doesnt exist do this" type thing however I don't think that's possible without 3rd party.

@Rhys Williams Did you ever get this working to hide fields? If so can you help  me?