Format metadata field in barcode

Hi all,

Apologies if this has been asked before, can see similar but none with metadata question:

I’m creating an output barcode:

${sheet.nr,00}${document.count.sheets,00}${document.metadata.AccNo,000000000}

I keep getting an error:

ApplicationException: cannot format value of class ‘java.lang.String’ at line 1, column 44 in pattern

Have tried changing the account number to integer and still get the issue.

I know it’s probably glaringly obvious but could someone nudge me in the right direction.

Thanks

Hi,
Metadata are text variables. So you won’t be able to format it with “0” format pattern.
You should format the variable before adding it into metadata.

Thanks Yann!

You learn something new everyday!

Formatted in datamapper and passed up to output.

Appreciate the steer.