I have my page P2000_Patient.
On this page i have an item P2000_Criteria_id (type: number field).
I want to create a button with dynamic action and based on this value to search my table and if this Criteria_id matches the contents of my table open the page P2002_Symptoms, otherwise open the page P2001_Episodes.
From what I see there is no need for a dynamic action to fulfil this requirement. Just create a button with action "Submit Page" and handle the logic to redirect to page 2001 or 2002 in a branch. Create 2 branches, one for each page and a serverside condition of "rows returned" for 2002 and "no rows returned" for 2001.