samwoo Posted June 9, 2016 Posted June 9, 2016 Hello, i'm trying to use a branch to detect whether or not an answer is empty. The Custom Expression below doesn't progress properly if you press "Next" when leaving the question blank: The only way to get it working is if you click in the field, insert a space then delete it... when you press next it detects it to be empty and progresses to the next set of forms. Otherwise just pressing next without adding the space in the first place will send it through the "No Match" direction which is not what we want. Could we have the following conditions added to the Custom Expressions (which ignores any input from the user in the third field) Question Answer IS NULL Question Answer IS NOT NULL Thanks, Samuel
Martyn Houghton Posted June 9, 2016 Posted June 9, 2016 Samuel What results do you get if you put in two single quotes, ''? Does that let it branch based on the string being empty? Cheers Martyn
samwoo Posted June 9, 2016 Author Posted June 9, 2016 Hi Martyn, thanks for getting in touch. When I use the '' it still take it down the "No Match" route of the branch. I'm testing this in the Self Service Portal so not sure if this is the reason why its not working. I did the "space" workaround and it did work, but not feasible as customers wouldn't know of this. Thanks, Samuel
Steve Giller Posted June 9, 2016 Posted June 9, 2016 Does this use SQL structure? If so, what happens if you use != '%' as the test?
samwoo Posted June 9, 2016 Author Posted June 9, 2016 Hi Dead, Sadly that doesn't work Thanks for the suggestion though. I believe its called Flowcode, so it doesnt use the same SQL structure that we are used to. Thanks, Samuel
Steve Giller Posted June 9, 2016 Posted June 9, 2016 Shame - I partly asked as I'm not migrated yet, so it was both something to try just in case, and something to be aware of when we do upgrade.
Gerry Posted June 13, 2016 Posted June 13, 2016 Under the hood this will be an ECMA expression... However, I expect that we are quoting any static value that is entered in, so putting the value undefined in the field probably results in an expression som_var == "undefined" Now I am not sure this will work but try entering the following value into the field &[undefined] and that might work, although just a guess, its something to try. Gerry 1
NeilWJ Posted June 14, 2016 Posted June 14, 2016 The progressive capture is a javascript front end engine. It does not use any flowcode scripts or serverside mechanism (that is the BPM). So when you are testing to see if value exists you have to use javascript reserved word undefined. You can do this by just typing in undefined in the box. To test for empty value, where the value (variable) exists but it is just blank, just leave the value box empty. The front end progressive capture engine might set all values to empty when not set by the user, so you might just need to test for empty values instead of undefined. Cheers 1
NeilWJ Posted June 14, 2016 Posted June 14, 2016 So to make testing this easier i have just added a "Is Set" and a "Is Not Set" operator. When selected the value field will be disabled as you are just testing the presence of the variable and if it has a value. So expect to see this option soon once its gone through beta, until then use the above. Cheers 1
samwoo Posted June 14, 2016 Author Posted June 14, 2016 Hi Neil / Gerry, This is awesome! I will try out the current workaround. Now we could do different things with forms, where questions are answered / are not answered would take it down a different route. Or within the BPM - where an external ref is not set then create a human task to remind us to set it for example. Many thanks, i'll keep an eye out for this update , Samuel
TrevorKillick Posted June 15, 2016 Posted June 15, 2016 Hi Samuel The functionality mentioned by Neil has been pushed to live. Kind Regards Trevor Killick
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