Auto-Archive Client Documents for Compliance: Automate Your Business Processes - Ep.6
0 views
Jun 19, 2025
On June 17, join us for the next episode of our new live show ''Automate Your Business Processes' as the hosts, Mahender Pal & Sandeep Mishra, will discuss Auto-Archive Client Documents for Compliance! This Power Automate flow automatically extracts all attachments from incoming Gmail messages and stores them in a specified folder within Google Drive, ensuring seamless organization and accessibility. 📺 CSharp TV - Dev Streaming Destination http://csharp.tv 🌎 C# Corner - Community of Software and Data Developers https://www.c-sharpcorner.com #CSharpTV #csharpcorner #TheCloudShow #CSharp #interview
View Video Transcript
0:02
[Music]
0:13
[Music]
0:29
[Music] greetings everyone
0:36
welcome again for the another episode of business application automation
0:41
where we talk about that different use case different scenario how you can automate your business processes
0:48
depending on different different scenarios so on every
0:54
session we take one use case and we define like you know what are the tools and technologies we can use to automate
1:01
uh that particular process okay so we are today back with the another one
1:09
so let me share my screen and here
1:38
okay um I hope uh you can see my screen see can you please yes yes yes okay
1:44
perfect so today uh we are going to talk about that
1:50
uh how we can automate customer document how we can automate the archival of the
1:57
customer document so you know in uh when in every business when we you know work
2:03
with different type of customers we there are many document that we receive from customer and then you know we keep
2:10
track of those uh documents and we put them on a centralized location so this
2:15
is the use case for today that we are going to talk about so we'll start with the basic introduction of our use case
2:21
and then we will discuss that what is potential proposed solution for this uh
2:26
you know use case how we can automate it of course there could be you know different scenarios there could be
2:32
different ways to automate it but from our side that could be the proposed solution that we can use for automating
2:38
that okay so we will discuss about the Gmail connector so we will discuss how
2:43
we can utilize Gmail connector to work with the you know email and get their documents and then we'll discuss about
2:50
the power automate so that we'll be you know working as a workflow engine to you know connect these Gmail documents and
2:58
getting that email and getting that attachment for us and then we will discuss about that excel connector you
3:04
know to uh let's say for example when we are getting some email we have some attachment when we are putting that on
3:10
some location maybe we want to report some details like you know when we received uh this document from which
3:17
customer we received this document so these type of details we can you know store on a centralized uh excel file
3:24
with the details that is required for you know our business and then Google drive and this is another connector that
3:31
we are going to talk about which is basically we are using to you know put our document on a centralized location
3:37
on the Google drive okay and then we'll see demo so we will what are all these
3:42
uh connectors how we can use them so we will see on that uh demo here so before
3:50
jumping on the main topic let's have a quick introduction about ourself so myself Mahinder and I have my friend
3:57
Sundep Misra with me so we both are Microsoft MVP as well as Corner MVP so
4:02
we have been working with you know this Microsoft technology Microsoft ST it's
4:07
more than uh you know 10 years now so we uh uh yeah so that that's a quick
4:14
introduction about ourself so let's jump into our main topic
4:22
yeah so as I said that today use case is that when we are working with uh
4:29
different type of customers and in every project we require a different type of documents right and that sometimes that
4:36
document we are getting from customer over the emails right so they are sending emails and in those emails they
4:42
are attaching those documents which is required for our business okay and
4:48
depending on the different different scenarios different different requirements so it can be that it may be
4:54
that you know for some kind of uh you know audit purpose or there are some compliances that you need to fulfill for
5:01
your company we need to put all these document on a centralized location so we need to do archival of these documents
5:09
and of course when we are putting these document on a specific location we need to make sure that it is not you know
5:15
unnecessary access by everyone okay so for example if uh if I am the account
5:21
manager for particular customer so maybe I just want to make sure that nobody else is able to access those document
5:28
because those document may have some kind of you know uh secured information or maybe there are some financial
5:34
information that is there that I don't want to expose to other users okay the
5:40
other uh members who are working on project so that could be the different requirement
5:46
where we want to you know manage place our customer document securely and in a
5:52
centralized posh place right so it could be different depending on that what type
5:57
of resources you have maybe you want to put it on some server maybe you want to put on some cloud right and in the cloud
6:05
you want to put it on the one drive or you want to put it on the Google drive depending on that if maybe you have some
6:11
other you know Azure location where you want to put these documents okay so
6:16
today we are going to show that how uh when we are using these connectors that
6:21
uh we are you know going to discuss next using these connectors when we are getting that email how we can you know
6:28
fetch that email details how we can extract that you know attachment that is part of the email and then we can place
6:36
them on the s centralized location and how we can fetch the detail that is part of the email okay so these these uh type
6:45
of thing that is the use case for today and of course when we are putting the document on a specific location you want
6:52
to as I said that it should be secure it should be easily accessible so for
6:58
example when we place that document there and later on I want to refer that document so it should be easy for me to
7:04
access that document and refer it whenever I need it for any kind of you know referring any kind of detail that
7:10
is part of that document okay so those type of thing that is basically required
7:16
when we do this kind of uh you know implement this kind of system to archive
7:21
these document for you know that we are getting from our customer okay so that's
7:28
the use case for today so as I said that there could be different potential
7:34
solution for that but according to us that could be one of the proposed
7:40
solution here so we are basically today you are uh you know here using the first
7:45
thing that we are using Gmail connector so this we are using for the email communication so in earlier sessions we
7:52
demonstrated how we can use outlook connector for the you know email communication but here today we are
7:58
going to use the Gmail connector so this connector we will be using for that uh
8:03
getting that email and then the power automate is basically the workflow engine that will help us to coordinate
8:10
between these connectors you know passing that data between these connectors that we are fetching and
8:17
getting from these connectors and then we will be using Excel online
8:23
that basically for recording the details uh that is from the email maybe the date
8:29
or name of the customer so those type of thing for that we will be using here
8:34
Excel and Google Drive will be the centralized location where we will be
8:40
placing that document after the extraction from the email so this is the proposed solution but of course
8:47
depending on your requirement depending on your business scenario that can uh you know you can have some kind of
8:53
another layer on that or maybe you you have some kind of another connector that
8:58
you can use but in a simple way these are the you know possible uh connectors
9:05
that we can use to the you know building this archival system
9:11
okay so first thing Gmail connector
9:17
so connectors are you know very much you know used when we are working on the
9:24
power automate okay so power automate basically help us to connect with the
9:29
different uh you know application which is basically you know cloud application
9:35
those those are you know uh from Microsoft or non-Microsoft applications
9:40
so for example this is a Gmail is a Google application right so in the power
9:46
automate we have a connector which we can use for fetching that details or
9:52
performing different tasks on the Gmail so as you can see here that we have a trigger so basically you know when new
10:00
email arrives so if you will connect uh so of course when you select the connector you need to do uh the
10:06
connection first okay so you provide the detail you authenticate that okay you are a valid user so you provide those
10:13
details and then it is connected to your email right so basically the Gmail
10:18
account when it is connected then you can use this trigger so whenever you will get email into your Gmail account
10:26
automatically your automation will start right and after that you can see that we
10:33
have a different type of action that is available here so whether you want to reply to some email you want to send
10:40
email delete email or get the email details so whatever you know the detail that is uh coming along that email uh
10:47
the body of the email subject of the email who is the sender if and there are
10:52
some attachments so you want to get those attachment so those kind of action that is available under the Gmail
10:59
connector okay so we can use this uh connector to work with the emails that
11:06
is coming into your Gmail account okay so you need to uh connect with this
11:11
connector and after that we can utilize these actions and trigger to get the
11:16
data from our Gmail account
11:22
now power automate so our main focus for
11:27
the automation is utilizing this workflow tool so this is basically a Microsoft cloud workflow uh you know
11:35
tool that help us to automate our task okay so we have different type of
11:40
variations that is uh for the power automate so in our so we mostly uh you
11:46
know all our session that we have done so far we are talking about that Microsoft Power Automate cloud
11:52
application where we can build our cloud workflows and we can connect with
11:57
Microsoft and non-Microsoft application using connectors so if there are
12:02
connector available we can utilize them if there is no connector available of course we can build our own connector
12:09
and for our purpose and also we can publish it so that other user can also
12:15
use it so it's like kind of a m you know we can have a marketplace on the Microsoft mic marketplace where we can
12:22
publish our connector and then you know other users can utilize that connector to connect that uh particular uh
12:29
application that we are targeting into our connector right but we have lots of
12:35
connectors here thousands of connector that is available uh you know these are like in the Microsoft stack we can see
12:43
like you know office 365 or dynamics you know application or share uh point or
12:49
you know any any business application most of thing that we can easily connect using the power automate okay so and
12:57
because we are using Gmail connector so that is also there we can utilize that for the automation
13:07
okay now excel online so excel online is basically a another
13:15
uh you know connector that is part of the power automate we can utilize this
13:20
to create our Excel file or fetch the data from Excel file or perform
13:25
different type of action that you can see here this is a a huge list here that we can perform on that Excel connector
13:32
using that Excel connector okay so let's take an example that uh maybe uh we are
13:39
when we are getting that email we want to make a note of that okay what is the
13:44
subject of the email when we received it and who is the customer uh you know from
13:50
where we are getting this email if this is just an example that if you want to keep track of these and we want to
13:57
prepare a uh you know centralized file where we can store these type of detail
14:03
so we are using Excel connector here so we can use that to create file update
14:09
that record onto that file and if you want to fetch the data we can also fetch the detail from that Excel file so this
14:16
is another way to storing our data on a centralized location so we are using
14:22
Excel online here
14:31
okay so another one the another connector
14:37
that we are going to use is the Google drive okay so as I said that when you
14:42
want to extract that attachment from the email you want to store it to some place
14:48
right whether it could be your system so that is basically you know uh the location of your server or your internal
14:55
uh system that is part of your organization you want to store it there but in that case you will have a you
15:03
know limited uh way of accessing it right so you need to be part uh you know
15:08
be in the office and you want to access that file then you can do that but if you want to make sure that when I put
15:15
the document I want to make sure that I can access it from any location so let's say if I'm not in office okay so I'm
15:23
traveling or maybe I'm in client location and I want to access those document right so in that case I want to
15:30
put that on a cloud right and that cloud could be different here so it could be
15:35
you know Microsoft cloud it could be any other Microsoft vendor uh you know non-Microsoft cloud or for example here
15:43
today we are talking about that Google drive so this is another cloud uh uh you
15:49
know where we can keep our document on a centralized location and we can access
15:55
it from any place you don't need to be in the office so while you are traveling or you are in a client side or you are
16:02
you know out of office or out of station at any point of time if you want to refer the document you can easily refer
16:08
that from the Google drive okay so you can see here that we have a different type of action that is part of the
16:14
Google drive connector so we can create our file so we can get that you know file and delete those files all all the
16:22
most of the tax that is you know required when you want to work on the file that is part of the Google drive
16:30
here okay so this is uh we can utilize this to work with our uh you know Gmail
16:37
connector but if we are not using Gmail connector let's say we are using outlook
16:43
connector to you know fetch that email and attachment in that case also we can
16:48
get the data and put it there so it's not like we need to you know because we are using Gmail connector then we need
16:55
to use the Google drive only so we can use that non-Microsoft connectors easily
17:00
to communicate between these you know application and passing the data back and forth and that's the beauty of the
17:07
power automate it allows us it help us to communicate between different application whether they are part of the
17:14
Microsoft or they are not part of the Microsoft stack so we can easily connect them with each other okay so that's what
17:23
uh you know here for the Google drive Now let's see that how we can utilize these
17:30
connector to build that uh you know this customer I uh document archival system
17:36
the documents that we are getting from the customer how we can put them on a centralized location using these
17:42
connector so I will jump uh you know pass mic to my friend uh sep and he will
17:50
showcase the demo all the steps that we discussed all the connector that we discussed so far so sep over to you
17:59
so thank you Mahanda for your
18:05
wonderful content let me share my screen and just confirm if you are able to see it
18:12
share screen is it visible
18:18
um yeah it's loading uh yeah we can see it now yep okay so as Mahendra explained
18:26
in some of the businesses what uh we need that sometimes we need document
18:32
which is coming on email to store somewhere so in future whenever we want
18:37
to access that document we will act able to access those uh in a structured way
18:44
so most common scenario we can take like uh if you are in a CA business every uh
18:50
every month we need some kind of documentation like bank statement or company document and we can't miss those
18:57
documents we need to store those document somewhere so whenever required you can go and check it so that's the
19:03
scenario we are using and in this case we are using the most used uh email
19:09
system and that is Zmail so if you are getting documents on Gmail how you can
19:15
uh uh download those document and store in Google drive so uh I just created a
19:21
simple flow where the trigger point will be when email arrives when you will
19:28
receive email like the the person who wants to store document like the either
19:34
CA or whoever professional so when email arrives on your Gmail the first thing you will do that you will get the client
19:41
data from Google sheet why because you don't want to store each and every document so you have some client list so
19:50
for some particular emails you want whenever email coming from those emails
19:55
then only you will uh download those document and store in Google drive then
20:01
you will check that if email has an attachment because if there is no attachment you don't need to run this
20:06
flow and if email in that particular list in only that case you will uh store
20:13
that file in client list and you will also create a log so in future whenever
20:18
you want to check that when you got that particular email you will have that particular log and if not then we will
20:26
just end the process so this is the scenario we are going to use so let me
20:31
open power automate and I will create a new flow so I'll go here we will take
20:37
automated cloud flow and I will search here for Zmail as a trigger
20:46
so let me
20:51
so I will take this when emails arrives that's the trigger trigger point and
20:58
then the next point is that uh we will take client information from Google
21:04
sheet and for that I already created a f folder and under that folder I created a
21:09
Google Google seat and I added one client information so based on that like
21:15
if you want to add more client information that this is how you can add I also added another seat where we are
21:22
going to add the log so I created this seat this is how you
21:28
need to prepare and I also created a folder so whenever we are receiving email from this particular client from
21:36
this particular email we'll use this folder to res store the documents
21:43
so this and once you will able to do this then we'll come here and we will
21:49
add
21:56
Google drive so we need a connector from Google drive
22:02
to get a row and we will select so I will select the
22:09
file I created in compliance folder so I will go here
22:14
and select this Google seat so once I will select it will also give us option
22:21
to select the seat if we have like two or three seats that is what you will get in this dropdown so I will select the
22:27
client that is where I have the client information the next thing you can see that is row ID so one thing you need to
22:36
uh care here whenever you are getting a row or updating a row in Google drive
22:42
that whenever you will attach something in power automate you will get this row
22:47
id but if you go to this document you will not able to see any any uh column
22:52
name with a row id but you will able to see this the power apps id that is what
22:58
row id is so whenever it is asking for like the give your row ID data it means
23:04
that whatever data you have in this particular column that is what you need to provide there so what I will do is I
23:11
will just use the from email address from where we are getting
23:17
that email address because that's the email address I want to use to get this
23:24
particular record so I will go here then the next step after this that we will
23:30
add a condition
23:36
so I will use this condition and the
23:41
condition will be like the the items should be there
23:47
for example
23:54
I will take this and we will take the email address equal
23:59
to the from email address so I will use this from
24:05
so from email address should be equal to the the item we are getting from this
24:11
Google sheet the next we will add that is
24:18
email should has attachment so I will add like again we'll go here we'll click on
24:29
dynamic parameters and then you can see we have uh these many options here so
24:34
we'll use this has attachment equal to I will select true
24:43
and then we'll add it the next thing is that
24:52
we'll add another action that is
24:57
apply to each because uh might be in that email we will have multiple
25:03
attachments and that's why we we will use apply to each and as a input we will take attachments
25:10
then the next thing is to create Google drive create a file in Google
25:16
Drive so I will use this create file and then we'll give the path
25:24
so again I will select that folder compliance
25:29
but here we can't directly select this folder because what we need is we need to provide this value dynamically so I
25:37
will just use this
25:49
just use
26:08
So I will just combine the both values the static value we have for that folder
26:22
and then the variable client folder name
26:29
so that just dynamic value and the
26:37
path so now you can see like we are getting this static value and the path we are getting from this particular
26:45
column so we'll go back here and I will add
26:51
then the file name uh we can create either we can directly use the file name
26:56
we are getting from that particular attachment so I will use this
27:17
so file name we can just get from the apply to current item
27:36
name
27:45
a segment we will take item from here
27:57
then question mark and then we'll take the name
28:16
so this is how like from this item we will able to take the item now
28:33
name and then
28:38
content from that particular file
28:52
can you see
29:06
so again I will get from the item so I will go here select the item question
29:11
mark and I will take the content byes
29:24
like this and we will save it the next thing after this
29:32
we will create a log and we'll create in that Google
29:38
drive file i will go here insert row
29:44
i will select that path
29:53
and then again I will select the seat
30:00
and then we will add date here might can take from dynamic parameters
30:08
go here receive date subject I will take subject
30:15
and the path I will take from here
31:08
We And I let go
31:46
so I just save it so you can see now what we are doing is when email arrives we are getting the item and then we are
31:52
creating a file and inserting a log here with a subject so now what I will do is
32:00
that I will just go here and send a email
32:10
from this particular email address
32:20
documents i'm just
32:59
If I send an email uh let's Yeah
33:56
so let me test with this particular flow
34:06
so now when new email arrives that is working then we are getting row then we
34:11
are initializing a variable and then it's matching the condition
34:22
yeah the file is created and then we inserted log here in this particular
34:28
file so you can see log is here
34:37
and if we go back to this particular folder and refresh this you will able to
34:42
see the document I attached in this particular email
34:48
so this is how like this is totally based on the email address we are using even though email is coming from any
34:54
email address this flow is not going to run it will only run for the email addresses we created and added in this
35:02
particular client list so this is how you can create a client list and if you
35:07
are getting emails from a particular email address you can use this flow to
35:12
archive those documents in a specific folder
35:18
with that I am now going to hand over the stage to Mahendra
35:31
hey Sep thank you thank you for explaining this uh demo for that uh
35:37
client archival uh system that uh we wanted to cover today so yeah so uh
35:45
thanks for joining us and we will be back for the another episode where we will take another use case and uh we'll
35:52
showcase how you know we can use Microsoft or m non-Microsoft uh tools to
35:57
automate your business processes so stay tuned for the another episode and you
36:02
can watch all our uh existing uh sessions on the YouTube uh on car corner
36:09
live so all the sessions are available there so provide your feedback and thanks for joining us today thank you
36:15
very much thank you thank you very much
36:21
[Music]
36:34
[Music]