Conditional Formatting in ExactTarget Personalized Subject Line - email

How can I setup conditional formatting using ExactTarget personalization? I want to only show the punctuation if the first name exists.
For example, if name exists subject is NAME! Rest of Subject. but if the name field is blank then Rest of Subject.
%% first_name %%! Rest of Subject. ends up returning ! Rest of Subject. if my first_name value is blank.

%%[
If Not Empty([first_name]) Or [first_name] != "" Then
Set #salutation = Concat(ProperCase([first_name]),'! ')
Else
Set #salutation = ""
EndIf
]%%
%%=v(#salutation)=%%Rest of Subject.
Notes:
This assumes that the column with first name is "first_name";
This assumes that the first_name column could come in as NULL or empty;
The space that will appear after the exclamation point is in the variable;
Place this in the email, and in the subject line input field, insert: %%=v(#salutation)=%%Rest of Subject.

Related

Azure Data Factory - Dynamic Skip Lines Expression

I am attempting to import a CSV into ADF however the file header is not the first line of the file. It is dynamic therefore I need to match it based on the first column (e.g "TestID,") which is a string.
Example Data (Header is on Line 4)
Date:,01/05/2022
Time:,00:30:25
Test Temperature:,25C
TestID,StartTime,EndTime,Result
TID12345-01,00:45:30,00:47:12,Pass
TID12345-02,00:46:50,00:49:12,Fail
TID12345-03,00:48:20,00:52:17,Pass
TID12345-04,00:49:12,00:49:45,Pass
TID12345-05,00:50:22,00:51:55,Fail
I found this article which addresses this issue however I am struggling to rewrite the expression from using an integer to using a string.
https://kromerbigdata.com/2019/09/28/adf-dynamic-skip-lines-find-data-with-variable-headers
First Expression
iif(!isNull(toInteger(left(toString(byPosition(1)),1))),toInteger(rownum),toInteger(0))
As the article states, this expression looks at the first character of each row and if it is an integer it will return the row number (rownum)
How do I perform this action for a string (e.g "TestID,")
Many Thanks
Jonny
I think you want to consider first line that starts with string as your header and preceding lines that starts with numbers should not be considered as header. You can use isNan function to check if the first character is Not a number(i.e. string) as seen in the below modified expression:
iif(isNan(left(toString(byPosition(1)),1))
,toInteger(rownum)
,toInteger(0)
)
Following is a breakdown of the above expression:
left(toString(byPosition(1)),1): gets first character fron left side of the first column.
isNan: checks if the character is "not a number".
iif: not a number, true then return rownum, false then return 0.
Or you can also use functions like isInteger() to check if the first character is an integer or not and perform actions accordingly.
Later on as explained in the cited article you need to find minimum rownum to skip.
Hope it helps.

Combining rows from multiple sources in Virtual list Filemaker

I am trying to make an Excel-like 'pivot table' in Filemaker using a Virtual List as the source of the data. The issue is I want to be able to have 'categories' down the first column that aren't fixed. The field names won't work.
My current thought is to have a table with a field of the layout name and the categories, that I would combine with the rest of the data via a ExecuteSQL (or other function).
I can get it to work with two ExecuteSQL statements, one for the categories and one for the 'bulk' of the data, using text for the WHERE in the categories eSQL, then I combine them into one and I'm set.
My issue is that I'd like to be able to get the categories using a get(LayoutName) function, making the script more flexible. Whenever I use the get(LayoutName) in the WHERE line of the SQL I get a ? for the result. I have also tried putting the layout name in a field using a get(LayoutName), then using that field as in the WHERE statement, but that also returns an error.
I admit I am a bit of a newbie at this, so the problem is likely between the keyboard and the chair with a simple syntax error. I have tried a bunch of different ways with quotes, no quotes, single quotes, etc.
Here is what I am using for pulling the categories...
Substitute ( ExecuteSQL ( "SELECT Category_List
FROM Categories_VL
WHERE Layout_Name = Get(LayoutName)" ; "" ; "") ; ", " ; $$delim )
All of the field names are correct, and if I change the LayoutName to a text that matches the Layout_Name field I want, it works fine.
I apologize if I have been too wordy, but I figure more info is better than answering a bunch of questions because I forgot something!
TIA!
I am struggling to understand your question. I hope I am addressing the correct issue.
You cannot use Filemaker functions inside an SQL query. To find records where the Layout_Name field is equal to the current layout's name, your query should be:
SELECT Category_List
FROM Categories_VL
WHERE Layout_Name = ?
and then you would supply the current layout's name as an argument:
ExecuteSQL ( "SELECT Category_List FROM Categories_VL WHERE Layout_Name = ?" ; "" ; "" ; Get ( LayoutName ) )
Note that instead of substituting the default delimiter, you can specify your own field and row separators within the ExecuteSQL() function itself, for example:
ExecuteSQL ( "SELECT Category_List FROM Categories_VL WHERE Layout_Name = ?" ; $$delim ; "" ; Get ( LayoutName ) )
See: https://help.claris.com/en/pro-help/#page/FMP_Help%2Fexecutesql.html%23

Swift Firebase Must be a non-empty string and not contain '.' '#' '$' '[' or ']'

This is a follow up to my previous question. I am trying to see if an email has already been used.
I am using the line
if snapshot.hasChild(email) {
I have in my database an email test1#test.com
When I type that in..the moment I get to the '.' before com the app crashes and gives an error that says this
Must be a non-empty string and not contain '.' '#' '$' '[' or ']'
I see a lot of posts about checking for usernames, but my app doesn't have usernames, just email. Am I able to use email with
hasChild(...) {...
Firebase keys cannot contain a . (dot) character. If you want to store an email address in a key, you'll have to encode it. The common way to do that is to replace the . with a , (comma), which conveniently is not allowed in email addresses. So test1#test.com would be encoded as test1#test,com.
I don't think you're actually storing the email address as a key, but I'll follow up for that on your previous question.

Trim all characters in a field after a certain character

I have a column titled email. Obviously this is a list of emails. where someone has 2 emails in their record, the database separates them by ' ' (space).
I need to deleted everything from the space (including the space)
I've tried
UPDATE employee SET email = TRIM(TRAILING ' ' FROM email);
which I found in heaps of other posts but it does nothing!
Thanks!
You can use:
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_substring-index
it should be something like:
update employee set email = substring_index(email, ' ', 1)

Print fields being browsed on the screen

I need to write a FM script which print one field of the records being browsed on the screen and separated by commas.However, I do not know how to select the records being currently browsed and am not able to find it in the documentation (the lack of the good keyword could be the problem).
Thank you!
It sounds like you're trying to create a list of all values for one field in the Found Set. FileMaker 13 introduced the List of Summary type, which makes this pretty easy:
First, create a Summary field, say FoundAddresses. Make it a List of your e-mail address field. This field will contain a return-delimited list of the e-mail addresses in the Found Set.
Second, create a Calculation field, say FoundAddressesCommaDelimited. Make it the following text Calculation:
Substitute (
GetSummary ( FoundAddresses ; FoundAddresses ) ;
ΒΆ ; ", "
)
This will substitute all of the returns in FoundAddresses for comma-space.