Reputation: 23
I have a super simple logic app workflow that triggers when a new row is added to a SQL Server Database and sends an email from a pre-specified address to another pre-specified address with variables from the row that was added.
I am having difficulty figuring out how to slice a string from the SQL data... One of the variables is called "invoiceDate" and I am able to refer to it in the logic app code view as "@{triggerBody()?['invoiceDate']} but an unable to perform slicing functions to it. I only want the first 9 characters of that variable to populate in the email and the slice function does not treat it like a variable.
Upvotes: 0
Views: 251
Reputation: 11262
You need to use the substring
expression.
This is a basic example ...
The expression in the second step is ...
substring(variables('String'), 0, 9)
It's getting the first 9 characters of the String
variable.
Result
Upvotes: 0