Getting MS CRM "Account Email" for use in PI®
NOTE: The example below uses:
LEVEL: Intermediate-to-Advanced
--------------------------------------------------------------------------------------------
As a work management platform, PI is central to many key workflows. One of the biggest requests we get is ingesting sales & order data into the project system. (We have many solutions for this, BTW.) What happens when you go through all the trouble of closing a sale, building the Sales Order... then what? You email a project manager to double-enter everything into PI??
Nobody has time for that! 🤣
An easy way to handle this is to send your CRM Account data to the PI Company item as soon as it's created or updated in your CRM. And since MS Flow has a Dynamics 365 connector, it's a pretty straight-forward operation:
- Create a new Flow
- Assign a trigger for when an new Account record is created/updated
- Connect it to an HTTP object
- Set your PI token and JSON field matches
Inside the CRM Account record:
Inside the PI Company item:
The challenge is MS CRM--like many other systems--don't use "modelProperties", or ways to expand their queries--forcing you to make multiple passes at their APIs.
In the case of passing Email, it doesn't come over as a straight string. In fact, if you try to pass CRM's value for it, Email will be blank: the CRM value from MS Flow is an object, not a string. Think of it as two embedded elements:
The outer circle represents ALL the account information; the inner circle is part of the Account, but Contact also has its own universe of items. Rather than duplicate or make a gigantic Account record listing out each Contact field, MS creates a Contact object within the Account record to essentially make that information reusable across the its system. Unless you know this, you will keep asking why the Email field keeps coming up blank in PI!
SOLUTION
After you have set the pattern to update your PI Company record, add another step to go and fetch the Primary Contact Email by using the Account Primary Contact identifier in the previous step. Create a new HTTP object that updates the same PI Company record with the new email address (or whatever else you need to populate):
Questions? Need a CRM-to-PI key workflow for your business? Contact me:
kevin.perkins@projectinsight.com
Happy Coding!
Please sign in to leave a comment.
Comments
0 comments