Not applicable

Format Date in Drawloop Document Generation

Jump to solution

I am using Drawloop to generate document from Salesforce. I have a date merge field populated on Word Doc. Just wondering how to format the date to a desirable format, eg DD/MM/YYYY?  By default it's populated as Month Name DD, YYYY (eg: July 4, 2016)

Reply
7 Replies
Y_Mushell
Apprentice

Re: Format Date in Drawloop Document Generation

Jump to solution

Hey Edy Loi,

In the field tagger when you select the specific field you're working with (as opposed to using the --View All-- option in the list) you'll get an additional option to select the format, which will give you a new tag that has the formatting as you've selected.

For example the standard <<Today>> tag would be <<Today__s>> for DD/MM/YYYY

(I've understood your question to be that you were using a DDP tag and not a MSWord Mergefield. For Word mergefields you'd need to use a field switch to add the format)

Reply
Not applicable

Re: Format Date in Drawloop Document Generation

Jump to solution

Hi Yisroel, that works! Thanks a lot.

Normally I used the view all and did not realised this option.

0 Kudos
Reply
Y_Mushell
Apprentice

Re: Format Date in Drawloop Document Generation

Jump to solution

My pleasure Edy, glad I was able to help.

All the best.

0 Kudos
Reply
Not applicable

Re: Format Date in Drawloop Document Generation

Jump to solution

That's great but I have a date time that i want to display as a Date only.  When I look at the options I don;t get that.  I think I can use QuickParts in Word and use Date but I can't figure out where it goes.  I have a field <<Table1_Start>><<Table1_EndDate >>

Thanks for any assistance!

0 Kudos
Reply
Y_Mushell
Apprentice

Re: Format Date in Drawloop Document Generation

Jump to solution

Hey Eleanor Bockley​,

Formatting the date time field as a date can definitely be more complex.

When adding another date formula field in SF is not an option I've used mergefields in Word for extracting just the date from a date time field. You'll need to put the DDP tag for the datetime field inside the mergefield and also add the picture switch to tell Word which part of the datetime field to display.

Hit Shift+F9 which will give you a special set of curly braces and place your tag inside the grey area and then add the format switch. It should look something like this: { MERGEFIELD <<Table1_EndDate >> \@ "m/d/yyy" }

(you can change the formatting for the date as you wish by changing the text within the quotes e.g. "dd/mm/yyyy" )

Extra challenge here is that if the field is null for a given record it will show an error message instead of just staying blank. To get around this you can nest the entire mergefield into another one with an IF statement and your cell will look like this:

<<Table1_Start>>{ IF "<<Table1_EndDate >>" = "" "" "{ MERGEFIELD <<Table1_EndDate >> \@ "m/d/yyy" }" }

It's cumbersome, but has worked when I've had no other option.

Good luck!

Reply
Not applicable

Re: Format Date in Drawloop Document Generation

Jump to solution

You are the best!!!  I knew I had to use that but couldn't figure out where to place the field tagger.  Followed your example and it worked beautifully!!!

Thanks you SO much!

0 Kudos
Reply
Y_Mushell
Apprentice

Re: Format Date in Drawloop Document Generation

Jump to solution

Great! Glad I was able help.

0 Kudos
Reply