Skip to content

[ISSUE] - FromId Field Queries break export #1194

@dschibster

Description

@dschibster

Issue title
Querying FromName / FromId breaks the query as it places a duplicate FROM in the query.

Issue summary

    {
      "query": "SELECT Id, ActivityId, BccAddress, CcAddress, FromName, FromId, HtmlBody, TextBody, Name, Subject, ToAddress, ValidatedFromAddress, RaltedToId, ParentId, RelatedToId FROM EmailMessage",
      "operation": "Upsert"
    }

Using this export, or any other export including the FromName or FromId fields will result in the following error:

[18:04:51.205] [ERROR] Execution of the command has aborted due to unexpected error:  Source, ReplyToEmailMessage.Id, From.Id, RelatedTo.Id, EmailTemplate.Id                                 ^ ERROR at Row:1:Column:473 Didn't understand relationship 'From' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names..

It's easy to see why: there is a second FROM inside of the query:

Query string: SELECT Id, Name, CreatedDate, LastModifiedDate, SystemModstamp, TextBody, HtmlBody, Headers, Subject, FromName, FromAddress, ValidatedFromAddress, ToAddress, CcAddress, BccAddress, Incoming, HasAttachment, Status, MessageDate, IsDeleted, ReplyToEmail... FROM .Id, RelatedTo.Id, EmailTemplate.Id FROM EmailMessage.

Steps to reproduce
Use above export object to run an export.

Expected behavior
The query is executed and parsed as per usual.

Actual behavior
See above; process fails.
Removing the FromId/FromName fields does fix the export.

2026-04-27__18_08_38.log

Metadata

Metadata

Assignees

Labels

bugSomething isn't working, looks like a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions