For my SmartConnect integration, I need to run a CRM/CE Query to pull the list of CRM Contacts and send them to an external destination.
As part of this query, I also need to get the guid of the assigned Account. Other information seems to be pulled correctly – however the Account guid (AccountId) is blank for Contacts that I know are properly assigned to an Account. Why doesn’t it display correctly in SmartConnect?
If you’d rather watch a video explaining this, click here.
SmartConnect will return the results of any data source if there IS data to present and an empty field if not.
Testing this, we create a simple CRM Query against the Contact entity and pick a few relevant fields including the Account field required.

Using the Data tab to preview the data shows that all of the values DO seem empty – most of them are in this sample data but there should be some populated in the dataset.

Using Fiddler to trace the response to see if this is a “CRM Issue” or a “SmartConnect issue”, it seems to show that no data is being returned for that field. We can see in the request (top) that the Accountid field is being requested but no data for the field is returned in the response (bottom) and that is why SmartConnect shows the empty data because none was returned.

To try to work around the issue, I added in the Account entity and linked on the Account field. This defaults to an “inner join” in the query and you would maybe switch the Link Properties to make it an “outer join” by marking the “Select All From Left”.
After switching the link, also marked the Account, Account Name & Account Number fields from the Account entity to visibly see data from that to verify that it is linking properly. Wouldn’t need to show the empty field but left the Contact.Account field marked for comparison.

Clicking the Data tab runs the query and manually sorting on the Account.AccountId field to show the returned data, we can see that indeed that the Account guid is visible (along with the other two Account values)but the Contact.Account is still not.

At this point, we unmark the Contact.Account since is still empty and instead the map would use the account_accountid field to get the guid value.