+ Start a Discussion

Error 5077 in Excel Connector Query Wizard (duplicate field selected)

I get the following error when querying tables using the Excel Connector's Query Wizard:
Error Generated by Request::
SELECT Account_ID__c, Name, Account_ID__c FROM Account
ERROR at Row:1:Column:29
duplicate field selected: Account_ID__c
ExceptionCode : 5077                    
A previous user had mentioned this same problem in a post that's now in Kingsley's post "Welcome & Earlier Discussions" but I could not find a solution posted.

I see that there is a duplicate field in the SELECT clause, but don't know why this is happening. Did I do something strange in configuring my sf tables? I assume this doesn't happen to most users or this would have been discussed more.

I did find a workaround, but if this is a symptom of another problem, or if there is a way to make the tool work as expected the first time, I'd love to hear! Thanks.

Although you'll get the above error at first, when the wizard closes, your spreadsheet will list all of the columns. Delete the columns that contain the duplicate fields (eg: Account_ID) and then use the Query Table Data function from the "sforce Connector" floating toolbar to re-run the query.

This is probably caused by having two (or more) custom fields which have the same field label. For example, you might have two fields:
     Field label: Account ID    Field name: Account_ID
     Field label: Account ID    Field name: Account_ID2
The names used by the API (which is used by the connector) would be the same as the field name, but with "__c" appended, thus:
    Account_ID__c and Account_ID2__c
The problem you have with the connector is that it allows you to use the field label in place of the field name. Thus it generates column headings, based on the labels, of:
    Account ID and Account ID
When you try to use the column headings for a query or update, it translates these labels back into the field names by looking them up in a list of labels and names. The trouble then is that both of the two columns translate into the same field name --- the first one which matches --- or Account_ID__c. Thus the duplicate name.

You have two options. You can tell the connector to use the names rather than the labels --- and live with the uglier names, or you can change the labels for your custom fields so that the labels are unique.

To change the connector, use the sforce Connector / options menu item, then the Use Names tab, and check the option ("Do not generate API ....").


Thanks for the reply. I see what's happening now.

Apparently all of the salesforce tables have fields like Account ID, Contact ID, etc already built in, even though these fields are apparently not revealed in the setup screens.

I had gone and added an autonumber field to each of these tables just to have a unique number on each, not realizing that there are in fact hidden fields already using those names.

At least I think that's it!

So I will probably just delete mine.