web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove item from varia...
Power Automate
Answered

Remove item from variable string

(0) ShareShare
ReportReport
Posted on by

Hello, 

 

I need to remove an specific mail from a string variable made from outputs of  'When a new email arrives in a shared mailbox'. 

 

When I iniziate the variable, the value is :

 

triggerOutputs()?['body/toRecipients'];triggerOutputs()?['body/ccRecipients']

 The output of this step is a string of mails separated by ";". 

 

From this array I need to remove an specific email and I don't find the way to do it. I've tried to convert the output to an array and filter it but I got an empty array. 

 

Can anybody help with this?

 

Thank you!

Categories:
I have the same question (0)
  • Verified answer
    Manish Solanki Profile Picture
    15,167 Moderator on at

    Hi @aorro933 

     

    Here is the sample flow for you.

     

    I have used a variable 'EmailRecepients' that stores the email addresses in to & cc as shown below:

    ManishSolanki_0-1699272220602.png

     

    Next, add filter array action and write an expression in the "From" parameter. Expression needs to be added in the expression box as highlighted in the below screenshot:

    ManishSolanki_1-1699272352884.png

    split(variables('EmailRecepients'),';')

    pls replace the name of actual variable in the above expression.

     

    To enter the filter query, click "Edit in advanced mode" and enter the below query in the textbox:

    ManishSolanki_2-1699272491206.png

    @not(equals(item(), 'a@a.com'))

    Here I am removing 'a@a.com' email address in the list so pls enter the email address which you want to remove from the recipient list.

     

    Finally, add compose action and use expression to join the array elements by semi colon (;):

    ManishSolanki_3-1699272685447.png

    join(body('Filter_array'),';')

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard