PC Alan Halliday - a serving constable with the Lothian and Borders division of Police Scotland - is said to have contacted the dealers by phone after he found out their house was about to visited by drug squad officers last month.
The 44-year-old constable was immediately suspended after police discovered the alleged contact between the officer and the dealers.
PC Halliday was arrested and spent a night in the cells before making an appearance in private at Edinburgh Sheriff Court last month. He was released on bail after making no plea or declaration, and will return to court to face the allegations at a date still to be decided.
PC Halliday, from Musselburgh, East Lothian, is currently a member of the East Lothian Community Action Team (ELCAT) after he was seconded to the unit.
A Crown Office spokesman confirmed Mr Halliday appeared on petition at the capital's sheriff court on 28 March charged with two counts of perverting the course of justice. No date has been set for his return.
A Police Scotland spokeswoman confirmed the officer has appeared in court after being arrested last month.
She said: "A 44-year-old serving police officer was detained and arrested on 27th March 2014 for matters arising in the East Lothian area. A report was sent to the Procurator Fiscal and the officer has appeared in court."
ELCAT is funded by East Lothian Council and was formed in 2008.