You are viewing limited content. For full access, please sign in.

Question

Question

Update word document table merge - How to modify db field formats?

asked on August 15, 2017

Hi,

 

The Update word doc activity is such a great tool and I am using this on at least 10 workflows. But I have come to a situation using the Table Merge where the database records are not the format our users would like. Is it possible to modify the format just like you can using the Token editor? I have 2 columns requiring formatting:

1) A Date field that is displaying as Date and Time (we require Date in format dd/MM/yyyy).

2) A number field displaying with just 2 decimal places (we require currency format including the thousands comma separator and $ symbol) I know I can easily insert the $ symbol before the merge field. 

 

This is only an issue with Table merge fields (no issue with the Simple Merge fields as you can use the token editor).

I have been playing with the Type and Render field default options by inserting the token such as:

#,###.00

%(CustomQuery_Invoice_Amount#"c"#)

%(CustomQuery_Invoice_Date#"dd//MM//yyyy"#)

But no such luck. I couldn't find any documentation on Answers or the support site with examples on how OR if this can be done.

 

The only other option I can think of is using multi value tokens, but these will only be displayed in a single column cell.  The users require line borders between rows.

 

Any ideas?

 

cheers

screenshot.png
Render Field.png
screenshot.png (11.33 KB)
Render Field.png (29.69 KB)
0 0

Answer

SELECTED ANSWER
replied on August 16, 2017

Why not simply format the merge fields in Microsoft Word instead. 

Assuming your merge fields are called Invoice_Amount and Invoice_Date use these formatting switches inside your merge fields (you can display the code by toggling the Alt-F9 key

{ MERGEFIELD Invoice_Amount \# $#,##0.0 }

{ MERGEFIELD Invoice_Date \@ dd/MM/yyyy }

 

 

 

3 0

Replies

replied on August 16, 2017

You can either format the date in the query (convert(date, DATE_COLUMN)) or you can format the merge field in the Word document.

1 0
SELECTED ANSWER
replied on August 16, 2017

Why not simply format the merge fields in Microsoft Word instead. 

Assuming your merge fields are called Invoice_Amount and Invoice_Date use these formatting switches inside your merge fields (you can display the code by toggling the Alt-F9 key

{ MERGEFIELD Invoice_Amount \# $#,##0.0 }

{ MERGEFIELD Invoice_Date \@ dd/MM/yyyy }

 

 

 

3 0
replied on August 16, 2017

Excellent, thanks to both of you! Worked a treat!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.