could you try following?
update your formula like this:
If(isNullOrEmpty(manager),'Not Available',
toTitleCase(parseLookup(writeConsole(manager,isNullOrEmpty(manager)),false).split('.')'0])
+ ' ' +
toTitleCase(parseLookup(manager,false).split('.')'1])
)
and add following fnc to form's javascript
function writeConsole(val,isnull){
console.log('lookup val-<'+val + '> len='+val.length+' isnull='+isnull);
return val;
}
I would be really interested in what will appear on console...
(unfortunately I do not have possibility to test it on my own)
Thanks for the reply but not much information there. All I get is a bunch of permission denied errors:
SCRIPT70: Permission denied
File: NewForm.aspx, Line: 19, Column: 1
hm, I would say this is not related to the code I suggested to add.
what is line 19 about?
typically there are plenty of script includes at the beginning of NewForm.aspx, so it looks like you are trying to include a script/resource that you do not have permissions for.
No, I'm not adding anything besides the code you provided. At least not in the form's custom javascript section. I will try to reproduce this in a completely new form, with nothing else besides the SQL control and the calculated field that references it.
I have created a brand new list and get exactly the same error message. It doesn't seem to matter whether I put that formula in a calculated control or a form variable.
Adding the code you suggested also gives me the same error I reported above. Here is a screen shot.
so as I suspected, you do not have permissions to load (or a file doesn't exists) init.js script.
but maybe later on another init.js script with another locale might be loaded, so it need not be an error to care about.
I would still check console window (not script itself) whether it gives some output
After further study it appears that the problem I'm experiencing is NOT with the IsNullOrEmpty() runtime function, which works just fine, and not with the If() function, which also works. I suspect that the parseLookup function must always run no matter what, ignoring the surrounding logic that would tell it not execute.
hm, that's really interesting finding....
I've setup small testcase and can confirm the behavior as well.
ie., whichever out of three 'slt1' text field,' lkp1' or 'lkp2' lookups I have changed, parseLookup() from both branches were invoked
Hi,
which version of Nintex Forms are you using? I've got a similar issue with calculated fields and if condition, where both the branches were invoked.
I've opened a ticket and the issue has been solved with the last version of Nintex Forms 2.9 that has come out lastJune 20th, so if you're not on the last version I suggest you to try to update (have a look also on the other posts here on the forum about the changes in the lookup controls)
Giacomo
Yes, I was just thinking about doing that. I'm still on version 1.11.0.0 and was planning to upgrade today. WIll let you all know if this solves the issue!
I have completed the upgrade to 1.11.2.10. Alas, this has not fixed the problem.
Sorry to hear that, in that case I think you should try to open a ticket to support..
I finally did get this to work. The final version of the calculation is
If(isNullOrEmpty(manager),'Not Available',toTitleCase(manager_uid.split('.')(0] + ' ' + manager_uid.split('.')(1]))
where manager_uid is a variable = parseLookup(manager, false).
So it appears that the upgrade did fix the If() problem after all.
Thanks to all who helped me solve this problem!