Trying to edit grid gallery based on factors

I’ve been trying for a while and cannot figure it out. basically I’m trying to create a query to see if a product shown in the current gallery has any options if true i would like to add the text “From” in front of the price. sounds easy right? not for me…