sigi Posted July 7, 2018 Posted July 7, 2018 Hi, i'm sry but i was unable to find it. I'm only trying to do the following: If it matches x, open browser with that subsite if it matches nothing, open browser with that site If it matches nothing from above, open browser and do search How do i click something like this together?
vitor Posted July 7, 2018 Posted July 7, 2018 Welcome @sigi, What you’re looking for is the Filter Utility. Give it a go and if you bump into any trouble upload your Workflow somewhere so we can take a look within the context of your specific case.
sigi Posted July 7, 2018 Author Posted July 7, 2018 I made an simple example. https://filebin.net/4xgv8vlka9d7e5xp This example might be solved otherwise (i'm not sure) but the main idea is to have one path which gets only executed when nothing else matches. Tx!
vitor Posted July 7, 2018 Posted July 7, 2018 (edited) Simplest way is to have two filters, copies of the ones that already exist but with is not equal to instead. Like so. Also notice that on the Keyword you need to set Argument Optional or you won’t be able to activate the empty case. Edited September 23, 2018 by vitor Updated Workflow link
sigi Posted July 9, 2018 Author Posted July 9, 2018 Puh that might be a lot of work though. I was planning to do it for a few nodes like 10-20. A mix of 'go to, otherwise search' for our corporate portal. There is no better solution to this, right? Would it be possible to write its own function block to implement such a 'switch' block?
Tsunami Posted July 9, 2018 Posted July 9, 2018 (edited) Yes, you can use a Script Filter or Run Script object and choose from several scripting languages to write a switch block. Just return the corresponding URL and connect it to an Open URL object. Edited July 9, 2018 by Tsunami
sigi Posted July 9, 2018 Author Posted July 9, 2018 I meant more like a meta object. Similiar to filter or junction. A switch statement which asks every following node if it filter did match and if not, uses the default path.
vitor Posted July 9, 2018 Posted July 9, 2018 30 minutes ago, Tsunami said: you can use a Script Filter or Run Script object A Script Filter would be inappropriate for this, as it should act immediately after the Keyword. 15 minutes ago, sigi said: I meant more like a meta object. Similiar to filter or junction. No, there’s no such object. Do you need help writing the code for the Run Script? It’s simple enough that you should be able to understand what’s going on even with no coding experience.
sigi Posted July 9, 2018 Author Posted July 9, 2018 Thanks vitor but i will figure it out :). I do write code as a profession. I was just hoping to stay in the visual workflow editor part as long as possible.
vitor Posted July 9, 2018 Posted July 9, 2018 There is something else you might try. You’ll notice Filter has a matches regex case. Thought a does not match regex would be more straightforward in this case, that limitation can be circumvented with a negative lookahead. So let’s say you don’t want to match flower, power, and empty strings: ^(?!flower|power).+$.
sigi Posted July 9, 2018 Author Posted July 9, 2018 Its still quite cumbersome to extend it. For extension, i would need to add another filter or another entry in the regex which than becomes longer and more unreadable
vitor Posted July 9, 2018 Posted July 9, 2018 5 minutes ago, sigi said: Its still quite cumbersome to extend it. It is. It’s also easier to mess up (especially for non-coders) which is why I hadn’t mentioned it earlier. Given the constraints, the Run Script is your best option.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now