Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
Has anyone got experience doing something more advanced with Word documents
I am looking to do something slightly more advanced with my Word documents. For example if a certain merge field has no content, I want that field not to be displayed at all. I have spent the last few hour browsing the internet and in theory it doesn't look hard. In practice it seems to be very frustrating.

Has anyone got a sample they can share with me


Philipp Matuschka
Date Created
1/13/2016 12:44:05 PM
Date Updated
1/19/2016 6:40:36 AM
Slava Shinderov  Staff  1/13/2016 12:45:59 PM
@Philipp please learn more here: https://www.teamdesk.net/help/9.6.aspx
Philipp Matuschka 1/14/2016 4:55:39 AM

As with most things from you guys, this is excellent.

Are these #codes from you or are the MS Word stuff I couldn't find
Is there a #df to remove just a field without removing a whole paragraph? I tried #df itself and that produces an error, but maybe there is something like it

Philipp Matuschka 1/14/2016 5:46:36 AM
Actually, ignore my last question, it makes no sense
Philipp Matuschka 1/14/2016 5:47:54 AM
I've realised that if you were to remove a field from the middle of a paragraph, how would you know which text before and/or after belongs to it, so the way to do this is within TeamDesk
Philipp Matuschka 1/14/2016 6:31:28 AM
However I do notice that " " is treated the same as Null or "".

Why would I care? I have a table line which has three merge fields in it. These fields don't come from a table sub table in TeamDesk, they are just three fields out of the main table from which the document is called. If all three fields are empty then I don't want to display the line at all. So I thought that if I had a control field in TeamDesk which is either " " when anyone of the three fields has content or or "" when none of them has content and applied #dr to it, then in the first case the line displays and in the second case it does not. However it doesn't display in either case.

Any chance of differentiating between " " and Null or ""
Philipp Matuschka 1/14/2016 7:12:30 AM
Not a big priority as I have found a workaround, just a thought for sometime
Kirill Bondar  Staff  1/14/2016 7:21:11 AM
Blank fields from UI are stored as NULLs. While it was possible to store "" via assignments and API we have specifically disabled this path and converting "" to a NULL. The reason is consistency.

Suppose you've stored "" via an API, then edited the record via UI. There would be blank textbox for the field. Should we then store NULL (as it is now) or ""?

Suppose you have the view with "Field is <blank>" condition. In fact it checks for IsNull([Field]). Should it also check for "" or " " potentially slowing down the execution?
Philipp Matuschka 1/15/2016 1:23:41 AM
Kirill, I absolutely agree with "" and Null being handled the same way. In that case the field contains no characters.

I just don't think that " " is the same thing. In that case the field contains one character.
Kirill Bondar  Staff  1/19/2016 6:40:36 AM
1. UI and REST API converts both empties and whitespaces to NULLs.
2. #dp removes NULLs and empties but leaves whitespaces intact.
3. Comparisons do not take trailing whitespaces into account, so that "" = " ", but NULL <> ""; though Len("") = 0 but Len(" ") = 1
4. Assignments and SOAP API recognize NULLs, empties and whitespaces.

Back to Search Results