In my company we use e-conomic as our ERP system and it is also used to send invoices to our customers.
Now our commercial managers do not have access to e-conomic but they do need the information about what is invoiced to our customers.
We have build our own CRM system using a Model driven Power App where each commercial manager has access to his accounts.
So how can I give the account manager access to a specific invoice for a specific customer ?
Power Automate and the e-conomic api comes to the rescue.
First of all you need to sign up for a developer account at e-conomic – Developer (e-conomic.com) – this will give you the opportunity to build an app in e-conomic that you can install in your e-conomic ERP app.
There is a fine description on how to do this here – Connecting to the APIs using tokens (e-conomic.com)
When the app is installed you will get an AppSecretToken and a Granttoken – the App secret is generated when you install the app and the Granttoken is visible in the list columen “Adgangs-ID”
Set up the flow
- Go to https://make.powerautomate.com/
- Pick the right environment
- And choose create
- Then I picked “Instant cloud flow
But you could pick another type of trigger from one of the other connectors – perhaps react to an e-mail with the invoice number as a subject or ???
- Name your flow and choose the trigger
and click create - And in order to retrieve a single invoice I add an Input field
- Click the Next step button and search for the HTTP connector
and choose the HTTP action
- Choose the GET method and for the URI – you specify – https://restapi.e-conomic.com/invoices/booked/
and then select Invoice number from the dynamic content list of fields
and after the Invoice number you add – /pdf – !!!
- In order to authenticate the Http request against the e-conomic API – we have to add some headersThe headers has to be X-AppSecretToken and X-AgreementGrantToken
and you have to use the information from your App registration to get these.
- The http request will return a pdf document that then should be saved somewhere – when search for “create file” you can see a lot of possible places to save it
In this example I will save the file to a OneDrive for Business folder
So I choose a folder and name the file with the dynamic content of the invoice number and use the Body returned by the Http step as the content of the file that should be created.
-
Next up – lets save the flow and test it
so I enter a invoice number I know and hit run
And success
Final words
In our case we have enhanced the process a bit more and transfer the invoices to an Azure blob storage on a daily schedule plus we have integrated our model driven app with Power BI reporting. So the customer form contains a tab with a Power BI report filtered by the customer with access to all the invoices and KPI’s for the customer.
Hope this give you some inspiration as well.