How to make query loop block dynamic

How to make query loop block dynamic