Add spaces if length of field is too short

I'm working with X12 EDI files. I need the Interchange Sender and Receiver ID's to be 15 characters long. Rather than hardcode that value, I'd like to use a handlebars expression but I'm having trouble with that. I used the AI and got the following, but I'm getting an error that length isn't a valid operator in the #compare helper.

Here's the code I received:

{{#compare (getValue "record.[Interchange Receiver ID]" "") "length" "<" 15}}
{{getValue "record.Interchange Receiver ID" ""}}
{{else}}
{{substring (getValue "record.Interchange Receiver ID" "") 0 15}}
{{/compare}}

How can I alter it to get the desired result?

@jackharris so you just need to cap the length of the number to be 15 characters? If it's less, do you need to pad it? You should just be able to use something like this:

{{substring record.[Interchange Receiver ID] 0 15}}

I just tried that and it doesn't pad with spaces if it's shorter than 15 characters.

@jackharris there currently is no padding handlebar expression. You'll have to use a script to pad for now.