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 / Retrieve emails from s...
Power Automate
Answered

Retrieve emails from shared mailbox

(0) ShareShare
ReportReport
Posted on by 11
 
 
Hi
 
I am trying to retrieve flagged emails from a shared mailbox and then add them as a task in a Teams Planner
 
This is proving difficult as it's a shared mailbox I am using a Send HTTPS Request action which fetches the emails fine but the Output is an Object rather than an array so I then can't process the individual mails in an Apply to Each action
 
Much of what I have seen suggest using the output from the Send HTTP Request in the Apply to Each by using something like outputs('Send_an_HTTP_request')?['body']['value']) however this is not an Array (in my case anyway) so I am not sure how this would ever work.
 
I have tried converting the object to an array with 
Array(body('Send_an_HTTP_request'))
 
However the results don't really look like an array
 
Any pointers please?
 
Many Thanks
 
I have the same question (0)
  • Manish Solanki Profile Picture
    15,169 Moderator on at
    Hi, 
     
    You can use "Parse JSON" action and pass the output body of http action as its input. Post that you will get all the objects or array in the dynamic window from the output of parse json action.
     
     
    If this reply helps & solves the problem, pls mark it as accepted solution.
     
    Thanks,
    Manish Solanki
    you tube channel: Manish Solanki - YouTube
  • Verified answer
    Riyaz_riz11 Profile Picture
    4,204 Super User 2026 Season 1 on at
    Hi,
     
    Check HTTP Output Structure Run your "Send HTTP Request" once. Look at its output body flagged emails are usually inside a "value" array like body/value. Click the run history to see this.
     
    Add Parse JSON Action After HTTP request, add "Parse JSON". Use HTTP body as input. Generate schema from sample output ----copy full body from run history. This makes emails usable.
    ​
    Use Apply to Each on Parsed Value Add "Apply to each" after Parse JSON. Select body('Parse_JSON')['value'] from dynamic content. Now it loops through each flagged email properly.
     
    Create Planner Task Inside Loop In the loop, use email details like subject, sender from dynamic content to add "Create a task" in Planner. Include flag due date if needed via flag/dueDateTime.
    ​
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
     
  • CU30121719-0 Profile Picture
    on at
    Could you provide the output of your "Send HTTPS Request" action?
  • DA-20021519-0 Profile Picture
    11 on at
    Hi Riyaz
     
    Thanks for that reply!
     
    I have tried  as suggested but whatever I use for the schema when I do a test run the Apply to Each Action always comes back with
     
    Action 'Apply_to_each' failed: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')?['body']?['value']' is of type 'Null'. The result must be a valid array.
     
    or
     
    Action 'Apply_to_each' failed: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')' is of type 'Object'. The result must be a valid array.
     
    Depending how I pass the resultm of the Parse JSON to the Apply to each
     
    Any ideas?
     
    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard