I have resolved this by adding the option parse="inward"
to the {exp:playa:parents}
tag. So my code looks like below
{exp:playa:parents channel="article|blogs|calendar_events|contests|podcasts|videos" category="YOUR_DYNAMIC VALUE FROM PHP OR ANOTHER TAG" field="show" limit="24" parse="inward"}
// Do something here
{/exp:playa:parents}
The above code worked as long as there is no pagination required inside the playa:parents
block. For pagination to work you need to provide var_prefix="your_prefix"
option but then it will have to modify the code to reference your variables based on the prefix set. I avoided that by using embed. So basically you can put the whole Playa code inside another file and embed them where you want to use it. So the playa code will look something like below
{exp:playa:parents channel="article|blogs|calendar_events|contests|podcasts|videos" category="YOUR_DYNAMIC VALUE FROM PHP OR ANOTHER TAG" field="show" limit="24" entry_id="{embed:entry_id}"}
// Do something here
{/exp:playa:parents}
Note I have removed the parse option and added entry_id option which should be same as the parent entry ID you are trying to find the parents for.
Hope that helps!
parse="inward"
on playa expression and it worked.