Can't string match with Azure Logic Apps

David Broggy 6,291 Reputation points MVP Volunteer Moderator
2021-11-13T17:01:10.433+00:00

Hi there,

I need to simply validate that a string exists in my logic app.

Here's an example of the output from the previous logic app operator (Entities - Get Accounts)

I just need to validate that the 'ntDomain' line exists in the output.

I've tried the If/Then condition with 'contains' but it's not working for me.

Your help is greatly appreciated.

[
{
"accountName": "12345",
"ntDomain": "bob",
"isDomainJoined": true,
"displayName": "bob\12345",
"friendlyName": "bob\12345",
"Type": "account",
"Name": "00812488"
}
]

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2021-12-06T04:38:40.777+00:00

    @David Broggy I believe you might have already found the solution. But for other community members if in case the data is in JSON object then you can directly assign the json object to a string variable. If your data is in string in you don't have to perform this step.
    Now you can use the logic app expression contains that will return bool value based on the string matched or not. You can use the matching string according to your requirement.

    contains(variables('mytext'),'ntDomain')  
    

    155135-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.