In the real world, we often interact with more than only Microsoft 365 Tools and Software.
We will have a look at processes like generating Documents with 3rd Party sources, transform these docs and sign them online at a trusted Signer without printing any piece of paper.
All concepts normally base on API to connect and we will also create a custom connector. This will be fun and very productive in automation!
About Speaker:
Andreas Schlüter
- Consultant, Trainer & Enabler with Focus on Microsoft 365 and Azure
- Onboarding & Rollout Microsoft 365 - technical, conceptual, communicative
- Migration of Workloads On-Premises - Modern Cloud
- Many years of experience in the administration, setup and customizing of Microsoft cloud services
- Best Practices, possibilities & no-go´s
- Change, Learning & Adoption - Mindset-Blowing & Magic-Moments
Conference Website: https://www.2020twenty.net/power-platform-virtual-conference/
C# Corner - Community of Software and Data Developers
https://www.c-sharpcorner.com
#conference #powerplatform #powerautomate #csharpcorner
Show More Show Less View Video Transcript
0:00
Yeah, welcome from Germany
0:05
Here in Germany, it's about 6 p.m. or 8 p.m. in the evening
0:10
So my kids are going to bed next time. And I hopefully think you have also a great day with the conference
0:20
Very cool stuff. Very cool and informative slot sessions. Awesome. Awesome speakers
0:28
I'm really excited. So I hopefully can do it the same like the other speakers. So let's start
0:39
Yeah, maybe it's if you come from Europe, maybe you have seen one of our shows
0:46
In the show, I'm making processes as Mr. Power Magic for real world scenarios and connecting the dots
0:58
So we have solutions for the problem the users have with processes or business processes so we can make them working flawless in Microsoft 365
1:12
Yeah. If you like my session or do you want to connect with me, take the QR code for LinkedIn or the short link for LinkedIn or my Twitter handle so you can have the contact
1:25
That is just a bio. this is only marketing stuff. We don't need this. Okay, let's start. We only left time. So
1:36
what I want to do today in this session is to show you a real world scenario we've done with
1:43
Microsoft 365 at the processing center and third-party stuff and connecting this with
1:52
Power Automate and APIs. So mostly we work in Microsoft 365, but that's not our only one tool or
2:04
suite we need. We work, so we have to work with other third-party vendors and tools because this
2:14
is for line of business or something like that. And the gap between the third party and the
2:21
Microsoft world is the connection and getting data from one place to the other place and get the data back or something like that
2:29
And for this, I will show you a solution we have done at our client for making document processing e-signatures
2:40
And this is about a thousandth document a month. So it's very scalable in this concept
2:52
Yeah, all of this is based on APIs from the third-party vendors
2:58
So we will see how this works. What is the process in this scenario
3:07
Yeah, surely we have a third-party software and something happens in that
3:11
Maybe you have a new customer, if it's HR or it's ERP or CRM
3:20
So anything happens, you have a trigger in this third-party software. So you will get notified or you will have a trigger to start something to get this process working
3:33
This information from the third-party software will need to process the way for getting things done
3:44
And in this way, in Microsoft 365, this process gets the data
3:51
throw it in a Word template, generating PDFs from this, store it in SharePoint and list and sends it to another third-party software
4:02
to get a legal e-signature and get the document back, and the contract is finished
4:10
And sure, notifying some people. And this is everything we did with this process
4:19
And I will show you in the demo how we did this. Yeah, sending this to a trusted signer, getting the back store and going on with the next process
4:28
So we have in this process four steps. First step is one
4:32
We have the third party input where we start our process. The second step is processing this all in the Microsoft 365 ecosystem with Power Automate and SharePoint, Word, all the stuff, OneDrive, also Teams, and so on, where the document will proceed
4:56
get in the third step to the third-party e-signature solution and in the last step getting back to the M365 world
5:08
where it will be stored in document library and notify the people to move on
5:15
For the first step, in this case, our third-party vendor is StephCloud
5:22
And StaffCloud is, like the name, is a software as a service for managing staffs for events or for, yeah, mostly for events
5:35
And this is from Switzerland. And this is for this what they do, managing events and staff
5:44
It's very cool, very good software, nice features. You can use it
5:50
You have a very big, big staff pool. In our case, it's about 700 people for staff and volunteers
5:57
And you can manage anything, any kind of events. During the COVID-19 pandemic, it's a little bit less with events
6:08
But on the other hand, there are many hospitals who need extra staff for managing all the cases in the hospital
6:24
And also for this kind of event, you can use StaffCloud to manage these additional staff for all these kind of events in the pandemic
6:38
And so the focus on this software is planning and managing people and events
6:44
And this, they do it very good. But on the other hand, everything else, what has to do with managing events and stuff
6:54
like contracting and something like that, they do not manage this. So we have to do it on our own
7:03
They have an API, but they do not have any webhooks yet
7:08
This is very sorry, but maybe we're hoping they will implement the webhooks very shortly so we can use them
7:20
So because they do not have webhooks, we have to pull the API regularly what resistant many traffic and that not cool because we can get any triggers from the software
7:35
So we have to poll every time has any thing changed. If yes, so give me the data
7:43
Okay, in the next step, we're getting the data from the StaffCloud API
7:50
Then we will need this data to fill a word template for the contract. It's called a base contract where all the basically stuff and details were
8:05
in the or stored in the template in the contract. From the template we'll create a pdf
8:13
and this pdf will be prepared for the trusted signer so the procedures will be
8:21
stored and then we will send it to the professional signer. This is the next step, step three
8:30
For this, we use the third-party software YouSign from Europe, from France
8:37
Also, a very cool software is a trusted and legally signer, so you can sign everything you want
8:45
It's contracts, HR, whatever you want. and you can collect many signatures
8:55
or you can collect signatures from many precipitants. It's not only that you have only two people
9:03
You can have 10, 20 people if you want or if you need. So for the regular use
9:11
maybe you know Adobe Sign or something like that, you can use it also
9:16
they have a web app where you can store your document. You can say the employee has to sign
9:24
in this area and then he gets a notification to sign his document. But for our case, we don't
9:32
need the web app first because we create documents programmatically. So we create
9:43
document, thousands document a month. We can't use a web app and the employees can't put the drag and drop the
9:53
contracts in the web app to make the signature. So this won't be, well, so we have also an API
10:05
This is very, very good documented and you can use it very well. And of course, the Usain, they support webhooks
10:12
This is very, very good for our case because so we start one flow after the other
10:19
And how does it work? We initiate the signing request. The base contract or the document will be uploaded
10:30
We are waiting that everybody has signed the document. And if that happens, Webhook triggers the next flow to get back the signed document and store it
10:41
And last but not least, this is the fourth step. We download the signed document from Usign, store it in SharePoint
10:49
Additional metadata will be stored in the library. And, of course, we notify the users via adaptive cards and teams so they can move on with the process and make the rest from everything
11:04
This is the short overview of the process, but we will see this now in the demo because everything else is only for reading
11:21
Okay, so where are we going to start? First of all, we have our software
11:28
software this is dev cloud where you can see we have events sorry for german but um
11:37
it doesn't matter it's only for the function we have here the employees we have the the events um
11:44
where um the staff will be managed and planned for for their um for the event and there's
11:56
This is all web-based, so we do not have it on-prem or something like that
12:04
Then we have many flows created, and additionally, in a SharePoint group, we have a SharePoint list for our flows that will be needed to store, transfer information, store it
12:26
create the document and then delete the information here in the document in the SharePoint list
12:34
So we do not want to pull for every piece of information
12:39
We do not want to pull the API. So we just get the information in one piece, store it here in SharePoint, processing the document
12:48
And then after that, we do not need them anymore. We delete them here in SharePoint because we have them in Steph Cloud
12:54
Okay, let's see the first step. For the first step, I said we have a trigger or information, something happens in the software. Maybe we have here in our demo user, that's me
13:14
You see there are many, many information. It's in German. It doesn't matter. So the qualification, what can I do
13:21
Can I make a barkeeper or am I able to host children or something like that
13:29
Do I have a driving license and which driving, which type of cars I'm able or allowed to drive
13:36
Is this only a car or is it a truck or something like that
13:40
How do I look? Is it how tall am I? Which languages do I speak
13:46
And all these stuff, you see many, many information stored about every staff
13:53
So many, many things. And, of course, every staff member has an own ID, for sure
14:02
And one thing that we need for our process is this. it's the status for the base contract
14:13
And now it's, in this case, it means the base contract is already signed
14:22
And I will now say, in my case, because we do not have webhooks
14:29
we have to trigger it by polling. I say in my status now requested
14:36
So I'll make in my staff member, I say I do not have a base contract
14:48
I need a base contract, and so I request it. So what do we now do with Power Automate and the Microsoft 365 system First of all we have one flow This is the flow for the first part This is the part to create the base contract
15:07
and get the signing request ready. So we will see how this works
15:14
No, this is wrong. Where's my flow? Oh, do not have it here
15:21
Sorry. So this one. Let's see what happens in this flow. So first of all, this flow is recurrent and every day at 6 p.m. it pulls the API at the StaffCloud service and looks if there are any staff members who have in their base contract status the status requested
15:52
If this isn't the case, they will get all the information from this user and then will process this flow
16:04
We were going to test it because I have this is on requested
16:09
OK, so we can test it. Just looking if I'm yes, I'm in the development environment, not getting this in the production environment
16:20
So now we're going to test it and we'll see what happens. Okay
16:29
I'll translate every step. So you do not have to learn German
16:35
So, okay. First of all, the recurrence every 24 hours at 6 p.m., but now we tested it
16:42
And then the question, isn't there any staff member who has a requested base contract
16:47
Yes, there is one person in this case. That's me, the demo user
16:53
And you see there are many, many things we'll get back from the API
16:58
And this is because the API, if you call the API from CephCloud
17:06
you will get everything they have, if there is a value or not
17:12
So they send you all the things you need, all the things they have
17:16
but not everything you need. So you see there are many things like
17:21
or many information with nothing. So we don't care. We get it with us
17:31
So it doesn't, it's no problem. Okay, we get the answer from the API
17:37
Then we pass the JSON about the scheme We have a creative from the first time we created the flow
17:50
Then we have some variables that will be initiated we need further
17:56
And then the next step is to see if there are something, if the condition is true
18:02
And what is the condition? It's really easy. the condition says if we have in the header if the content length is bigger than two
18:15
please proceed this flow because if we do not get any person a staff member back we only get two
18:24
brackets brackets the left and the right one so if no so if we only have the two brackets the flow
18:31
won't make this thing. Next step, we have a for each loop
18:39
because it could be that we will get more than one member here
18:43
So it has to proceed for all the members, all the staff members. So what will the for each loop do
18:50
So if we get a member back from the API, we just make formatting the date for the begin of the contract
18:58
We format a little bit the file name for the SharePoint list
19:06
That's not, it's just basic for pronouncing and something like that. Next one is t
19:15
We had also problems with blanks in the front or at the end of a name
19:21
And this, the API from Usain, the signer, doesn't like that. and throws exceptions if you have blanks in your name
19:32
So we have to trim it and be careful that this has no blanks
19:38
In the next step, we use one of the additional lists in our SharePoint
19:45
to create the staff member in our system so we do not have to pull the API any longer
19:56
The next step is to get the document counter. We have a counter where we count the numbers of documents
20:09
who are created and we use that for unique file names because the counter will be stored
20:16
at the end of the file name. So we have then a counter with trailing O's or zero
20:22
o's so or zero so we have the the right numbers okay this is uh then the next step you have to
20:30
add one to the counter because you have to write them up and then there's a big part this is where
20:37
the magic happens we are using the premium connector to get word templates and we fill
20:46
this word template with all these things with this information what we have seen here in the
20:54
web app all this stuff will be get in the word document from the word document we will create a pdf
21:05
this is the the one drive connector and for all these stuff of for for something from these
21:17
connectors you will need a premium lease license because not everything is in the standard but
21:23
there's also a thing I will show you how you can do this okay we'll get the PDF the PDF will be
21:34
stored in the document library and then we'll fill with additional information metadata so we have all
21:44
the things we need then we do not need the word document any longer so we delete it
21:51
and the next step is to update the status of the base contract in staff cloud because
21:59
if the API polls every time and looks if somebody requests a new base contract, we have to
22:09
make sure that we say he doesn't need any longer request a new base contract because we have already done this
22:21
So I'm just updating and looking so the first was requested and now it created
22:35
So the document is created. This gets back from this flow back to this dev cloud
22:45
Okay. Next step, we'll get the server document stamp for the signature from our CEO
22:53
because our CEO don't want to sign thousands of documents manually every month
23:00
So we'll get a signing stamp into the document so it's already signed from the CEO
23:09
So we do not have this to do this manually. This picture or this PNG will be translated in base 64
23:20
So we can upload this base64 hash into the document
23:31
So next step is to upload the base contract itself, the PDF
23:36
And in the next step, we upload the server stamp to get this server stamp into the PDF on specific places
23:52
And this is what we can see next. You can see this here maybe
24:00
Just a little bit small. So what you can see here now is that you can say on which page of this document
24:29
on which position the server stamp will be placed. And also what you can see now is if the server stamp is successfully implemented in this document, they will get a new webhook or call a webhook for the next flow
24:54
So in this case, the server stamp is uploaded into our base contract and is signed from the CEO
25:05
And the next step is for this first step, for this first Power Automate is, okay, I've created the base contract
25:13
I've loaded it or I prepared it for the signing process. And I started the next process, the signing process itself with the Webhook
25:25
So in the next step, we're just waiting 10 seconds. And in the last step, we delete the PDF, what we've uploaded into the signing because we don't need it any longer in SharePoint
25:36
Because, you know, if we store every thousand documents we've created in the month, we will get a very big library and we do not need this data
25:46
So we delete it. That was the first part of our process
25:50
So in the first step, we have information from the Steph Cloud API
25:56
We get it. we fill it in our document template or in our word template
26:01
we'll make a PDF, send it to the signer, sign it with our server stamp from the CEO
26:09
And now we are going in the second step to create the signing request with the participants
26:16
so the staff. And this is the second part. And you will see the first step was
26:24
creating this document. The second step, I'm just looking nine minutes ago
26:37
Successful. So the second step is getting the was triggered by the web hook
26:47
from the server stamp. So the server stamp was already successfully implemented
26:54
and we are here now saying the expiration date for the signing request is seven days
27:01
So if the staff member does not sign the document in the next seven days
27:08
the signing process will stop. So this is the variable we are here creating
27:15
The next step is to get the data we stored in our SharePoint list
27:21
So we do not have to poll the other AP any longer, get our dates, because everything we need, the ID from the SharePoint list, we'll get it here in the answer
27:33
We are getting the information we need to fulfill our signing request
27:43
And this is the step where the procedure for the signing will initiate it
27:49
In this step, we say what we want to do. We want to initiate a procedure for signing a document
28:01
the document we have already uploaded to Usign. So please, in the document which is already signed from our CEO
28:13
please say that there has to sign the member at this place
28:19
on page 4, page 9, and so on and so on. So this is prepared in this step
28:26
So there you can see like in the other picture on page 12
28:34
on this position, this is the demo user who has to sign
28:39
and in which file it is the file we have already uploaded
28:43
to the trusted sign. This is what happens in this step. This is the API from Usain, surely
28:51
Then we will get back an ID from the procedure. And this ID in the last step to check if everything has successfully
29:05
then we say start the procedure. What happened in this procedure? This is the next step
29:16
Maybe I can see it here. it's like in the first step from the other flow just sorry
29:32
this is the same and you can see it here if the member has finished or the members maybe it could
29:39
it maybe it could be more than one if the members have finished to sign this document start the next
29:46
webhook and start the next flow for getting the document back. So in this step, we have initiated the signature and the signature process has
29:59
So I can look in my email and I should have, yeah, get an email
30:09
Your base contract is ready to signing. Hello, Max, please sign your document
30:17
And then I only click on this and then you will see the web app from Usign where you can sign as a participant
30:26
You do not need an account or something like that. that you sign
30:30
If you only want to sign a document, you can do it this way
30:34
And you see, this is our PDF. It's about 12 pages. And you see on each page
30:40
here are all my information that we had in the StaffCloud member information
30:51
And you see, I have to sign in this way. This is the server stamp from the CEO
30:57
And we have to sign on this place and we have to sign on this place and this is the the staff member information you
31:11
can see all the information here are coming from the from this place and this is stored here in the
31:20
word document template and filled in so we have to sign it at least and last but not least
31:28
to sign this document electronic or e-signature. You will always need at least a mobile for getting a SMS
31:40
and you need an email address. And now I will get the code, push it in and say I will make it unique
31:52
just this one okay done and so if i have signed the document i can then download the finished
32:07
document so everything for me the process is ended but from the other perspective from the
32:15
from our process it's not ended so this was the second step creating the signature process
32:28
and getting ready so from the webhook the the process step one said we are ready
32:35
you can sign this document in this process we have already prepared and started the procedure
32:41
and when everybody has signed this document, we'll send a webhook to the next flow to say
32:49
okay, we are ready, we have done, you can get the document back
32:54
This is the last step in this scenario. This is the third part from our process
33:04
getting the document back from the sign And this, you can see, is already done
33:15
And in this step, the webhook started, triggers our flow. We'll get the information what we need to get the document back
33:27
some variables we initialize for filling additional metadata in the Microsoft SharePoint list
33:38
like the end date of the base contract. We have the begin date
33:43
and the end date is the begin date plus one year. So we can create this directly from this flow
33:52
And what happens here? We like the step before we get our employee data back from our SharePoint list what we stored already there the data we need we just formatted the date with the European points
34:11
It's a day, point, month, point, year. So we have to format it a little bit
34:19
saying when the base contract ends, the employee ID, and then in this step we'll get the signed document back
34:35
So we check in this step, we check is the signed document ready
34:41
can we get it back and send us all the details. Then the API says, yes, it's all ready, you can get it
34:52
We pass the JSON here, and then in this step, we download the file as a raw format
35:01
From the USign, we have the ID where we can get it. And if we have the document back from USign in the raw format
35:11
we'll store it in the document library where it belongs in our system
35:18
So it will be stored as a PDF and we'll get some metadata provided
35:26
So everything what we need will be stored in this document library
35:31
And of course, in this step, we go back to StaffCloud and say the status of the employee of the base contract is not created
35:42
It is already signed. This is then the last step. So maybe this way, no
35:54
Just looking, if you can see here, this is now the status is signed, the contract
36:02
So this gets back to the staff cloud. And last but not least
36:12
because we have successfully created the document, We'll notify our users with an adaptive card in the channel in the Microsoft Teams team
36:23
This looks like this. You can see it here. There's a new base contract signed
36:30
A new base contract was signed. Please provide the staff member with the necessary information
36:37
What is the name of the staff member from which day begins the base contract
36:46
And here we have a button to get directly to the PDF and the SharePoint
36:52
So we can directly show it here. And you see it's the same document we signed already
37:03
Or you can get to the member in StaffCloud by clicking on the adaptive card
37:09
So you can see in the flow, the members are or the users are in their environment where they belong in Microsoft Teams all day
37:19
So they don't have to switch to another program so they can stay in Teams
37:29
And the last step is to delete all the information we already had in our SharePoint list to provide these steps of information
37:39
This is one thing I want to show you and the next thing I'm just looking on the timetable
37:47
What you can see here is just here. Documents for, yeah
37:57
What you can see here this is the template It a standard in the online view
38:11
It doesn't fit the layout, but if you open it in the app, you will see that it's okay
38:17
This is our document template, and you see we have already all these fields, which will be filled by the data from the Steph Cloud, which we will do in the Power Automate flow
38:31
This is one thing. And the next thing is we have all these documents
38:38
Then stored in another. And then this is in the finally documents will be stored in another library
38:49
in another team because it belongs to another team. And this is everything we only need for helping to get the process flow
38:58
Because just one thing. Because we do not have webhooks yet in StaffCloud, we have to deal with something
39:08
What happens if we manually have to process the documents? Because maybe there is an event and you have a staff member who is already, must be on the event
39:21
And you can't wait to the next day till 6 p.m. till the next recurrence flow will start
39:28
So we had to deal with it. How can we make a manually without having webhooks and without polling every 10 minutes the API
39:40
So for this case, we had created a power app. And this is the point for dealing with different license
39:54
with premium and standard license for the users who need it. We have about 20 users who are working with the whole StaffCloud thing
40:09
but they do not all have a premium license to get the flows working
40:13
because that would be much to nobody can pay that. So we had to do this also, and we have done this with a Power App
40:27
and I will show you this Power App just for short. We've created a little Power App, which every user has in this team
40:35
who needs it has access to, and you see this is for the
40:39
base contract you can say request a base contract and all you need is the id from the employee
40:46
and if you have the employee and you click on request the base contract i don't want to do it
40:56
this this is production so i don't want to do it here but if you what happens if you get here
41:01
the ID from the employee and click on base contract requesting. So this can be what I said already
41:13
Every user can do this, but every user has only his standard Microsoft 365 license
41:19
There is no premium license. What happens in the background, you see here, there's a list, a SharePoint list
41:28
And this is our trigger list. So if you request manually a base contract, you create a new element in this list
41:39
So this can be done by everybody who wants to or works with this app
41:50
So no problem. But what happens? So if, and this is why we can provide everybody
41:58
with a standard license, but there's one user, a functional user who has the premium license And this premium user or this functional user is watching the SharePoint list and says every time when an element is created I will start my premium process
42:23
And this is the same process, like the first process for creating the document and prepared for signing
42:30
with the difference that in this case, we only get one member back
42:38
because we only provide one member if you request this manually. But the rest of this is all the same
42:49
like the first process we already had done. So this is a chance to deal with the different license
42:59
in the Power Platform and how you can make a trigger list
43:05
to trigger your premium flows. And, yeah, so I don't know. Are there any questions, Simon
43:17
Good, Andres. We're good. Okay. Yeah, so what you see, we have done these flow in four steps, three flows in four steps
43:33
So just switching back to my PowerPoint
43:43
Let me see. And this is the rest to the end. The conclusion of this, what we've done, this was
43:52
very hard work for me because I'm not a developer, but it was very, very fun to make this happen
44:01
And if you can see what happens when there will be thousands of documents automatically created
44:09
and they are all legally signed and so on. This was very fun. So what is the conclusion of this
44:17
for you to tell you beware of the API from the third-party software
44:23
Like I said, the one API gets you back everything they have, but you do not want
44:32
So we have to deal with the schema, with the scheme, because this was one of the mainly parts
44:38
what throws us many exceptions to deal with. Check the documentation of the APIs
44:46
and if you do not have a well-documented API, just take another window
44:54
It doesn't matter. So you're going crazy if there is no doc for the API
45:04
And test, test, test is something you have to do every time
45:09
Still testing, testing, testing, because everything, oh, I don't know how much we tested
45:16
how long we tested, but many, many times. And this is what I said
45:21
In many cases, you need premium connectors, but there are some things you can manage with
45:30
or deal with premium connectors. So take a functional user who only needs a premium license
45:37
to create all the flows and work with trigger lists or something like that
45:43
and don't trust the marketing bullshit from the windows this is one part
45:48
we had to deal with not everything what's on the package is in the package so
45:54
this was it and for this yeah stay safe and thank you very much
#Business Operations
#Business & Productivity Software
#Enterprise Resource Planning (ERP)


