Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

check if outlook subject is changed

(0) ShareShare
ReportReport
Posted on by

I'd like to add specific outlook messages to planner using power automate.

I want to check if the subject contains a specific string (I have a python script that changes the subject of the emails).

I want to know please if it possible to check if the subject of an email has changed?

 

  • Community Power Platform Member Profile Picture
    on at
    Re: check if outlook subject is changed

    Hi @DamoBird365,

    Thank you for all of your help, have a great day.

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: check if outlook subject is changed

    Hi @kfir1200 

     

    List Tasks and then use the condition action with expression length('value from list tasks') gt 0.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Community Power Platform Member Profile Picture
    on at
    Re: check if outlook subject is changed

    Hi @DamoBird365 ,

     

    Thanks, my flow is working perfect now.

    I have one last question please:

    how can i check if my planner dosen't have tasks? ( i mean something like check if the length of "lisk tasks" is greater than zero)

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: check if outlook subject is changed

    Hi @kfir1200 

     

    This is really a seperate question to the orignal. Yes it is possible but you would need to work it out.  You can create variables and you can increment them.  You can also apply a condition as part of a loop or simply create an array of numbers 1 to length(array) and use that as your apply to each source.  

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Community Power Platform Member Profile Picture
    on at
    Re: check if outlook subject is changed

    Hi @DamoBird365,

     

    thannks for the reply, I want to do something like this:

     

     

     

    int i=j=0;
    bool is_exists=false;
    arr - an array of outlook messages
    arr1- an array of the tasks in planner
    
    for(i=0;i<arr.length();i++)
    {
     for(j=0;j<arr1.length();j++)
    {
     if(arr.subject == arr1.subject)
     is_exists=true;
    }
     if(is_exists==false)
     create_planner_task();
    
     is_exists=false;
    }

     

     

     

    can i do this in power automate?

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: check if outlook subject is changed

    Hi @kfir1200 

     

    That's just an apply to each inside an apply to each.  Both take the different values from the two data sources and the 2nd apply to each will compare the current item of the first apply to each with the current item of EACH of the apply to each items to give you the result.

     

    Not sure how efficient it would be but it would work.  If you are running this on large lists though I guess it would need tested to the extreme as you might end up with a timeout.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Community Power Platform Member Profile Picture
    on at
    Re: check if outlook subject is changed

    Hi @DamoBird365,

     

    I want to know please if i can use a nested loops in power automate?

    I need to compare the subject of the email with the title of the plan in planner.

    I need to do something like that:

     

     

     

    int i=j=0;
    arr - an array of outlook messages
    arr1- an array of the tasks in planner
    for(i=0;i<arr.length();i++)
    {
     for(j=0;j<arr1.length();j++)
     if(arr1.subject != arr1.subject)
     do something..
    
    }

     

     

     

     

     

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: check if outlook subject is changed

    Hi @kfir1200 

     

    I went with the following which is the reverse of my original suggestion as I couldn't work out how to filter an array on -.  But the gets emails will just return emails with - in subject before the filter on order.

     

    DamoBird365_0-1616683154105.png

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

  • Community Power Platform Member Profile Picture
    on at
    Re: check if outlook subject is changed

    Hi @DamoBird365,

     

    My subject filter is: 

     

    string('-')

     

    and now it's working.


    I'm new to power automate and it's very different than Python so can you give me exmaple how i can check if the plan already exists using the subject of the plan?

     

    Thanks,

    Kfir

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: check if outlook subject is changed

    Hi @kfir1200 

     

    triggerBody()?['Subject'] is the data retrieved by your flow trigger and not the get items action.

     

    The subject filter is literally looking for a string, I am not convinced you can use an expression here but other members might know better.  Hence why I suggest that you filter on thes string order and then use a filter array action on subject contains -.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow