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?
Hi @DamoBird365,
Thank you for all of your help, have a great day.
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)
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
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?
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
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..
}
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.
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
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
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
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional