How to Concatenate a String with a Number in Power Automate
How to Concatenate a String with a Number in Power Automate
While building flows in Power Automate, you may need to combine text values with numbers to create unique identifiers, email subjects, file names, invoice numbers, or custom messages.
Power Automate provides the concat() expression that makes it easy to join strings and numeric values into a single output.
Why Concatenate Strings and Numbers?
- Create order numbers
- Generate invoice references
- Build custom email subjects
- Create unique file names
- Format user-friendly messages
Using concat() Expression
The concat() function combines multiple values into a single string.
concat('Order-',1001)
Output:
Order-1001Using Dynamic Content
You can combine static text with dynamic numeric values retrieved from SharePoint, Dataverse, Excel, or other connectors.
concat(
'Invoice-',
outputs('Get_Row')?['body/InvoiceNumber']
)
Creating Email Subjects
A common use case is generating dynamic email subjects.
concat(
'Order Confirmation #',
variables('OrderID')
)
Example Output:
Order Confirmation #1025Creating File Names
Concatenation is frequently used when creating unique file names.
concat(
'Report_',
variables('ReportID'),
'.pdf'
)
Example Output:
Report_5001.pdf Important: The concat() function automatically converts numbers into text values, so explicit string conversion is usually unnecessary.Common Use Cases
- Invoice numbers
- Order references
- Email subjects
- Document naming
- Customer identifiers
- Notification messages
Best Practices
- Use meaningful prefixes and suffixes.
- Keep naming conventions consistent.
- Use dynamic content whenever possible.
- Test output formats before deployment.
- Document complex expressions.
Key Takeaways
- concat() is the primary function used for string concatenation.
- Numbers can be combined directly with text values.
- Dynamic content works seamlessly with concat().
- Useful for file names, email subjects, and identifiers.
- Improves automation flexibility and readability.