Thank you, Robert.
I'll find a way to do it differently.
It occurs to me to pass the values I want to filter to the query widget and then look for the way that the user is the one who fills it in an external way without having to do it from the tool itself, and when the user opens the viewer the tool is open, as you told me in the previous answer, and the filtered layer appears.