How do I make certain items in my database link to a dynamic page based on if they are the reference for another item's field?

Hello! I am working on a website focusing on improving accessibility in the community. My site uses a database of local businesses to inform users with mobility issues about the businesses’ varying levels of accessibility.

I have run into a problem while trying to create a link for buttons on a repeater that lists all the available businesses. I want the buttons (#button1 and #businessName) to check if the business has any child businesses (for example a mall would be the parent business and its children would be the stores within it). If the business has child businesses/sub-businesses, the button will navigate the user to a dynamic subBusinesses page instead of the normal businesses page.
I have created a reference field in my Businesses database titled parent, and have made 3 tester child businesses that reference their common parent.

I believe I can do this using the utils.checkLink() method, but I have not been able to find information on how to use the checkLink() function. How does this function work? And is there a better way to accomplish my goal?