Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Condition check on customString in DevOps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I am creating a flow which needs to send email if ComplianceTag value is found in the Microsoft_VSTS_Common_CustomString09 field for a work item in DevOps.

 

I added a condition control, which check "Body" contains "ComplianceTag". This is not working. Can someone help how to add this condition.

 

..."Microsoft_VSTS_Common_CustomString08":"testing","Microsoft_VSTS_Common_CustomString09":"ComplianceTag",...

  • Verified answer
    kryalava Profile Picture
    Microsoft Employee on at
    Re: Condition check on customString in DevOps

    I have used this format and it worked.

     

    string(triggerOutputs()?['body/fields/Microsoft_VSTS_Common_CustomString09'])
  • v-litu-msft Profile Picture
    on at
    Re: Condition check on customString in DevOps

    Hi @kryalava,

     

    Could you share an instance of the work item?

    Please shield personal information.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • kryalava Profile Picture
    Microsoft Employee on at
    Re: Condition check on customString in DevOps

    Hi @v-litu-msft 

     

    Thanks for your reply. I tried using this solution but did not work.

     

    I created 3 new variables with 3 different values.

     

    Name: CustomString09
    Type: String
    Value: body('Get_work_item_details')?['Microsoft_VSTS_Common_CustomString09']

     

    Name: cs09
    Type: String
    Value: body('Get_work_item_details')

     

    Name: cs08
    Type: String
    Value: body['Microsoft_VSTS_Common_CustomString09']

     

    None of these have the value that I assigned in the customstring09 field of the work item. The value that I assigned in the customstring09 is simple string value tag1.

     

    Can you pls help.

    @v-bacao-msft Any suggestions will help me a lot.

  • v-litu-msft Profile Picture
    on at
    Re: Condition check on customString in DevOps

    Hi @kryalava,

     

    Contains function and condition action are check whether a collection has a specific item. Return true when the item is found, or return false when not found. This function is case-sensitive.

    Specifically, this function works on these collection types:

    • A string to find a substring
    • An array to find a value
    • A dictionary to find a key

    "Body" is a subject, so contains not work, you should put a string into it, for example:

    body('Get_work_item_details')?['Microsoft_VSTS_Common_CustomString09']

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow