0

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.

Logic App Designer Workflow

1
  • solved with @{slice(triggerBody()?['invoiceDate'],0,10)} Commented Dec 15, 2022 at 1:21

1 Answer 1

0

You need to use the substring expression.

https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#substring

This is a basic example ...

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

Result

Sign up to request clarification or add additional context in comments.

1 Comment

Solved with different solutions, slicing the variable directly... @{slice(triggerBody()?['invoiceDate'],0,10)}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.