Hi guys, 
I am trying to work on a flow that shows a message dialog that overlays a contact name instead of the number when i recieve a sms. 
I have tried adding a script prior to the execution if the message dialog. 
if  ($sms_sender == $contact_name) 
{
$global_Name =$contact_name;
}
else
{
$global_Name =$sms_sender;
} 
I also tried simply instead of the global variable jus calling it Name then copying Name to clip_data then added clip_data to the message dialog. All that clip_data contained was Name and not the variable. 
Am i doing something wrong? 
Sam
							How to overlay contact_name on Sms_sender
Moderator: Martin
- 
				sambarlick
 - Posts: 96
 - Joined: 27 Jul 2014 10:40
 
How to overlay contact_name on Sms_sender
- Attachments
 - 
			
		
		
				
- flow_group_Sms_Received_20140802_234328.xml
 - (11.44 KiB) Downloaded 760 times
 
 
Re: How to overlay contact_name on Sms_sender
Hi,
You can directly use the available variables without adding a dollar sign:
I did not understand the overlay part. Do you want to show a notification on screen containing the contact name when available or the number when no name can be found?
Something like this:
and then:
-action Notification on Screen: {text_to_display}
Regards,
Martin
			
									
									
						You can directly use the available variables without adding a dollar sign:
Code: Select all
if (sms_sender == contact_name) 
{
  global_Name =contact_name;
}
else
{
  global_Name =sms_sender;
}Something like this:
Code: Select all
if (contact_name=="") 
{
  text_to_display = sms_sender;
}
else
{
  text_to_display = contact_name;
}-action Notification on Screen: {text_to_display}
Regards,
Martin
- 
				sambarlick
 - Posts: 96
 - Joined: 27 Jul 2014 10:40
 
Re: How to overlay contact_name on Sms_sender
Thanks Martin, 
Yes, i am trying to show a contact name if known if not then show the number on a on Screen notification.
Sam
			
									
									
						Yes, i am trying to show a contact name if known if not then show the number on a on Screen notification.
Sam
- 
				sambarlick
 - Posts: 96
 - Joined: 27 Jul 2014 10:40
 
Re: How to overlay contact_name on Sms_sender
Hi Martin, 
I entered the text as you wrote it, when i receive a text from someone in my phonebook the contact name is displayed, but when i don't have her sms sender in my phonebook the returned value from the if state mentors is null.
Did i do something wrong?
Thanks, Sam
			
									
									
						I entered the text as you wrote it, when i receive a text from someone in my phonebook the contact name is displayed, but when i don't have her sms sender in my phonebook the returned value from the if state mentors is null.
Did i do something wrong?
Thanks, Sam
Re: How to overlay contact_name on Sms_sender
Hi,
Sorry, the check in the if should test if the variable is not set at all:
Regards,
Martin
			
									
									
						Sorry, the check in the if should test if the variable is not set at all:
Code: Select all
if (contact_name == null) 
{
  text_to_display = sms_sender;
}
else
{
  text_to_display = contact_name;
}Martin
- 
				sambarlick
 - Posts: 96
 - Joined: 27 Jul 2014 10:40
 
Re: How to overlay contact_name on Sms_sender
That fixed it. 
Thanks Martin, again!
			
									
									
						Thanks Martin, again!