Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

A COMPLETE READING OF EMAILS WITHIN POWER APPS

(2) ShareShare
ReportReport
Posted on by 7
Hello, community, how are you? I hope you're well! I'm a bit worried!

A rather complex demand has arisen here in my scenario:
 
I have a request from the client to have the reading of emails within Power Apps the same as within Outlook, with the possibility of reading emails, attachments, files, replies to each email and if possible in the same design.
 
That said, there's another problem: he has a main e-mail containing incoming e-mails, for example:
 
 
And in it, they have several people who can access the emails that are arriving in that email and reply normally, but with the static reply of “comercial@company.com”.

Here's a better example:
 
Imagine we have 3 users online:
 
  1.     user_leonard@company.com
  2.     user_abigail@company.com
  3.     user_chloe@company.com

Therefore, all the e-mails that arrive for “comercial@company.com” will be distributed to each of these users, i.e. if I receive 10 e-mails, there would be 3 for “user_leonard@company.com”, 3 for “user_abigail@company.com” and 4 for “user_chloe@company.com”.
 
However, each user would have to have access to the emails that have already been answered as well, and the possibility of categorizing them as well, or something like that.
 
What I've managed to do so far, I use a SharePoint list to register the users who are online, that is, those who have opened the app and automatically register the exit, and I would also like to register the exit from the app, some form of mouse tracking, or something like that.
 
And I've managed to split the emails between users as well, but I haven't managed to do the rest so far.One question: Is it possible to block the “to” of outlook, for example:

user_chloe@company.com” will open his e-mail online or local and whenever he receives an e-mail from ‘comercial@company.com’ he will forcefully reply with the user ‘comercial@company.com’ even though he is logged in to his user?
 

As I see it, I think this solution would be better done directly in outlook, or am I wrong?
 

Here's my code for dividing e-mails among online users in SharePoint
 
 
Set(
    vAnnexes,
    false
);
//View attachments becomes false when screen is visible
Set(
    vEmails,
    Concat(
        Distinct(
            Filter(
                App_LogHistory,
                Status = “ONLINE”
            ),
            EmailUser
        ),
        Value,
        ”;”
    )
);
// Step 1: Collect the emails in the EmailCollection collection
ClearCollect(
    EmailCollection,
    Office365Outlook.GetEmailsV3(
        {
            folderPath: “Inbox”,
            // inbox home folder
fetchOnlyUnread: true,
            // unread only
includeAttachments: true,
            //include attachments
top: 25//top 25 is Max, to change it is another story
        }
    ).value
);
// Step 2: Clear the Gallery3Items collection
Clear(Galeria3Items);
// Step 3: Iterate over EmailCollection to fill Gallery3Items
ForAll(
    EmailCollection,
    Collect(
        Gallery3Items,
        {
            FromEmail: from,
            SplitName: Last(
                FirstN(
                    Gallery3.AllItems,
                    Mod(
                        CountRows(Gallery3Items) + 1,
                        CountRows(Gallery3.AllItems)
                    ) + 1
                )
            ).Value,
            bccRecipients: bccRecipients,
            bodyPreview: bodyPreview,
            ccRecipients: ccRecipients,
            from: from,
            id: id,            
            replyTo: replyTo,
            importância: importância,
            internetMessageId: internetMessageId,
            subject: assunto,
            toRecipients: toRecipients,
            attachments: attachments,
            hasAttachments: hasAttachments,
            isHtml: isHtml,
            receivedDateTime: receivedDateTime,
            isRead: isRead,
            Anexos: attachments// Utilizando o campo de anexos diretamente da EmailCollection
        }
    )
);
 
And then I show the emails in a simple gallery called: Galeria3Items


Any help, suggestions or ideas are welcome! Thank you!
 

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