Robert Traill, and grandson of Sir James Stewart of Coltness (1608–1681), Lord Provost of Edinburgh.
His father, a distinguished lawyer and an active Whig, was appointed Lord Advocate by William II and III in 1692.
Dalrymple, uncle to Stewart's wife Anne, supported the candidacy of his nephew-by-marriage for Edinburgh in 1710 without success.
However Lord Oxford continued to leave the post vacant, and Stewart turned against the government, attacking ministers in Parliament over the New Woodstock election petition and the expulsion of Richard Steele.
He did not contest his seat in Parliament at the general election of 1715, but remained politically active in Scotland, supporting the government during the Jacobite rising of that year.