Ich dachte mir nichts dabei.
Is this considered an idiom? It should mean I meant no harm by it.
Also, how about Dabei kommt nichts heraus. "That doesn't get us anywhere."
(1g) Ich dachte mir nichts dabei.
(1e) I had no (further) thoughts when doing it.
Notice that I meant no harm by it is only one of the possible meanings of your German sentence. It may also be used in all the other senses of
(2g) Ich dachte mir nichts weiter.
as is the case with the English version. So no, it is not a fully fledged idiom. It is an expression which can at times take a contextually specified rather figurative meaning. Be aware that in spoken language you will come across
(3g) Ich hab(e) mir nichts dabei gedacht.
far more often in most parts of the German-speaking world.
(4g) Dabei kommt nichts heraus.
is not a phrase you will encounter too frequently. herauskommen means to be the result (literally to come out towards the speaker/interlocutor/contextually defined entity).
(5g) Was kommt heraus, wenn man fünf durch zwei teilt?
(5e) What will be the result if you divide five by two?
So what it means is that there will be no (relevant) effect. Not an idiom as well.
(6g1) Da kommt nichts bei rum.
(6g2) Dabei kommt nichts (he)rum.
on the other hand is -- finally -- an idiom more strongly related to merit or profit of a certain action; in most cases it will be synonymous with
(7g) Das rechnet sich nicht.
(no idiom, but sich rechnen should not be mixed up with rechnen) or
(8g) Das rentiert sich nicht.
(no idiom, all regular, but bearing the same meaning).
"Dabei kommt nichts heraus" - "That doesn't get us anywhere" works; more literally, it's "there won't come anything from that", e.g. when your bike/wallet was stolen and the police tell you you can, of course, file charges, but it won't be of any use, the bike/wallet won't be found, it's impossible to track down the thief. You can also ask around in your neighbourhood, nobody will have seen that bike thief. While you're there, you can ask them to fund you a new bike, but they won't be inclined to give you money. Or: Your company can put an ad in the newspaper, but it won't help them sell more products. Or: The four political parties are having talks to maybe form a coalition, but you're already sure that "nothing will come of that".
"Ich dachte mir nichts dabei" doesn't really mean "I meant no harm by it", but "I thought nothing of it" = "I wasn't thinking much when I did/saw that", "I didn't put any relevance to it".
Examples: you see heavily armed policemen at the train station and "think nothing of it"; later it turns out that somebody had threatened to place a bomb there. You accept a cup of tea from the son of the king, and it turns out that according to the local traditions you now have to marry him. You visit the White House and push a shiny red button, and it turns out you just launched a missile. You decide to dance to the catchy tune a street musician plays, and later your friend is angry at you because "you looked totally ridiculous, you weren't meant to dance to that, and in front of all those people!". Somebody gives you a peck on the cheek, and it turns out they're madly in love with you (and maybe you "gave them a wrong idea by letting them") / and your jealous significant other thinks you shouldn't have let them do that.