Suppressing Blank lines in "If..then...else" word mail merger - excel

I am trying to send out a mass mail merge email to clients who are in an accreditation process. I am using an Excel spreadsheet in the merger, and in the datasheet if the client has taken a class I indicate it with the number of credit hours (so they can also be added up as part of the letter). However since I want the class name rather than the number of credits it is worth I used the "if...then...else.." field. So that if the credit number is greater than 0 than the Class Name is inserted or else it is blank. My Merge field therefore looks like this:
{ IF { MERGEFIELD M_2713_CLASS } = 6 "Class Name" ""}
Where the "6" is the number of credits. There are about 40 classes entered as a list (one below the other). The problem I am running into is getting the classes that the client has not taken and are therefore blank to not show up as a blank line. I am not a programmer by any meaning of the word but I know there is a way to do it, I just can't seem to figure out even with the help of Google. Any suggestions?

The traditional approach is along the following lines:
{ IF { MERGEFIELD M_2713_CLASS } = 6 "Class Name A
" }{ IF { MERGEFIELD M_2713_CLASS } = 7 "Class Name B
" }{ IF { MERGEFIELD M_2713_CLASS } = 8 "Class Name C
" }etc.
I.e. You press Enter to insert a paragraph mark inside the IF field, at the end of the text you want to insert., instead of outside the IF field.

Related

Returns only returning single value from list

I'm trying to return values from list using return but it's only returning single value.
I want to get just numbers (3 tickets) from list of different tickets.
My code is:
tickets = find_elements(locator)
for ticket in tickets:
#Ticket name include full detail like section, row and number of tickets
txt =ticket.text
# splitting text eg: "2 tickets" from "2 tickets · e-ticket"
qty = txt.split()
return qty[0]
It's returning single number.
Please help me solving this and also this this my first question ever posted so pls accept my apologies if guidelines not followed.
Split with the char but not the space.
return txt.split('·')[0].strip()
In the above code we are splitting the text using · and the getting the first part with [0]. Finally, strip() will remove the leading white spaces.
Edit 1:
Here is the approach that you can store the tickets to the list.
ticketsList = []
for ticket in tickets:
#Ticket name include full detail like section, row and number of tickets
txt =ticket.text
# splitting text eg: "2 tickets" from "2 tickets · e-ticket"
qty = txt.split()
ticketsList.append(qty[0])
print(ticketsList)

document-wide ordered lists in ascii doctor

I would like to define a new style of ordered lists in asciidoctor that is composed of a fixed uppercase letter and a counter that increments. It has to be document wide. For example
A1. first item
A2. second item
some text
A3. third item
the flow of the text continues
The solution I came up with is as follows, which is heavy and not 100% satisfactory.
[horizontal]
A{counter:ol1}.:: first item
A{counter:ol1}.:: second item
some text
[horizontal]
A{counter:ol1}.:: third item
the flow of the text continues
Is there a simpler solution ? Is there a possibility at least to define a macro that would expand to A{counter:ol1}.::?
You have a couple of choices:
Create a macro in your editor that inserts the required markup (assuming that your goal is to reduce the amount of typing to achieve this effect).
Adjust the markup to specify a custom role and drop the counter:
= My document
:docinfo: shared
[horizontal, role=numbered]
A:: first item
A:: second item
some text
[horizontal, role=numbered]
A:: third item
the flow of the text continues
Then add some custom CSS, via a docinfo file (see: https://asciidoctor.org/docs/user-manual/#docinfo-file), that does the counting for you. This won't work in PDF output.
body {
counter-reset: myli;
}
.hdlist.numbered .hdlist1::after {
content: counter(myli) ". ";
counter-increment: myli;
}

OR Formula in Word document not returning a value

I am working on a document where I need to be able to test multiple options in an if statement to see if one of them are true to decide if a paragraph displays on the document. I have been trying to figure out why my OR formula is not returning a value for me to test and I am not sure why it is not showing anything when it is updating.
I have inserted a field and added a formula within that field that I am hoping will work with my If statement to show the proper paragraph contens.
When I use an Or statement, even one as simple as { OR(1=1) } and update and toggle the field I get no result. From what I have read I should get a 1 or a 0, but I don't seem to get either of these results. The line just ends up blank. When I test it with my If formula it always shows the false result, even when the Or contains a true result.
The formula I am currently working with is:
{ IF{ OR("$event.eventType.name}" = "Birthday", "$event.eventType.name}" =
"Conference" } "Yes" "No" }
If I update and toggle the Or field it shows blank, no result either true or false, and makes the If formula show as false event on results where it should show true. As I mentioned above I even tried setting it to 1=1 and still could not get it to show as true. Not sure if there is something I am missing in working with the formula.
Any suggestions would be appreciated.
It's not clear from your post what $event.eventType.name is. Presumably it's a field generated by an Addin. In that case, you should be able to use something like:
{IF{={IF{$event.eventType.name}= "Birthday" 1 0}+{IF{$event.eventType.name}= "Conference" 1 0}# 0}> 0 "Yes" "No"}
or:
{={IF{$event.eventType.name}= "Birthday" 1 0}+{IF{$event.eventType.name}= "Conference" 1 0} \# "'Yes',,'No'"}
Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required. If your fields are a kind of mergefield, you'll need to insert 'MERGEFIELD ' at the start of each one, thus:
{MERGEFIELD $event.eventType.name}

Lists in formula in Lotus Notes - trying to update each element

I have a multi-value field where users are able to enter multiple values. The field is a Name value field which holds the users email address. I am wanting to have the email address listed as the user's internet address and not as their organization unit/organization address.
Initially it appears as "Jane Doe/Sales/USA" and I want to have it listed as Jane.Doe#crown.com
This field will hold multivalues so it could be Jane Doe/Sales/USA; Fred Smith/Sales/KNC; Tom Jones/Accounting/ING
First off, is there a way of getting the internet address to be listed from the names field? I tried a couple of things that were supposedly going to display the internet address, but it didn't work.
I had a previous single value field and used the following formula to display it as an internet address:
Here is the formula I used. Hold Name listed the users name as their first name and last name.
HoldingLeft := #Left(HoldName; " ");
HoldingRight := #Right(HoldName; " ");
CompleteName := (HoldingLeft + "." + HoldingRight + "#newplace.com");
CompleteName
Since I am not familiar with lists in formula language, what is the best way to get the result I am wanting.
Your comments are appreciated.
Thank you,
Jean
This is a way to convert the fully qualified names into email addresses:
#If(FieldWithNames = "";
"";
#Replace(#Name([CN]; FieldWithNames); " "; ".") + "#newplace.com")
Assuming the names field is called FieldWithNames then we first test if it's empty. If yes we return an empty string. If no we convert the list of fully qualified names to a list of names only. Then we replace all spaces with "." and add the domain. We are lucky because #Name and #Replace can deal with lists.
This is a way to read the internet email addresses from directory for fully qualified names:
#If(FieldWithNames = "";
"";
#NameLookup([Exhaustive]; FieldWithNames; 'InternetAddress'))
We are lucky again as #NameLookup accepts as second parameter a list. It reads for every entry the internet email address from directory and returns the result as list.
In other cases, you might have to handle every entry of a list separately. Then you'd use #Transform(list; "variable"; [code doing stuff with variable])

Is there any way when I choose an option not to clear previously typed data in the input

The problem is this:
In my programme at first the user gets options for a first name - so hopefully he likes something from the options and he chooses it -so far everything is OK!
But then when he types space he starts receiving options for second name and a if he likes something and chooses it - then the Autocomplete just erases the first name. Is there any way I can change that?
hello Rich thank you very much or your response - now i've decided to change my task and here is what I made when a user types for example I character i get all the first names that start with I- so far no problem! ANd when he types the white space and K for example I make request to my web service that gets the middle names that starts with K or the last names that start with K (one of them should start with K for Iwelina), so in this case for Iwelina Ive got RADULSKA KOSEWA and KOSEWA NEDEWA! For the source of autocomplete I concatenate iwelina with (radulska kosewa)and iwelina with (KOSEWA NEDEWA) so at the end I've got IWELINA IELINA RADULSKA KOSEWA and IWELINA KOSEWA NEDEWA!!! the only problem is that when i type Iwelina K i get only IWELINA KOSEWA NEDEWA!!!here is the code for autocomlete
$('#input').autocomplete({
source: function(request, response) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term, " "));
var data = $.grep( srcAutoComp, function(value) {
return matcher.test( value.label || value.value || value );
});
response(data);
}
});
if you know how i can change it I will be glad for the help
I don't understand how, when the user begines to type the second name, he's getting results that are only the last name. For example, if he types "Joh" and selects "John" from the options, and then continues to type "John Do", then how is it possible that your drop down gives him results for only the last name, like "Doe"?
At any rate, assuming this is truly happening, you could just combine all combinations of first and last names in your source data and that will show "John Doe" in the drop down when the user types "Joh" selects "John" and then continues to type "John Do".
Another way to do this is with a complicated change to the search and response events to search after a space if it is there, and recombine it with the first string after the search for the last name is complete. If you give me your source data, I could put something together for this.

Resources