Whats the best way to convert a 1 or 2 digit number to a 4 character string? -- I have an integer that can be 1,2 or 3 digits -- regardless of how big the number is I need to convert it to a 4 character string to the SharePoint column --- so if it was 1, convert to 0001 if its 12 convert to 0012 , 123, 0123 - has to end up 4 characters .... . started down this path as an expression in a Compose - got ugly ....
If(triggerOutputs()?['body/TransmitNo'],<10,concat('000',triggerOutputs()?['body/TransmitNo']),
If(triggerOutputs()?['body/TransmitNo'],<99,concat('00',triggerOutputs()?['body/TransmitNo']),
If(triggerOutputs()?['body/TransmitNo'],>99,concat('0',triggerOutputs()?['body/TransmitNo']),
triggerOutputs()?['body/TransmitNo'])))


Report
All responses (
Answers (