INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Trouble with the IsEmpty(…) Function.  (Read 684 times)

exodus1977

  • Recent member
  • *
  • Posts: 25
Trouble with the IsEmpty(…) Function.
« on: January 31, 2014, 02:16:10 pm »

I'm having some serious trouble getting the IsEmpty(…) function to pass the correct info and need some help. 

I have a custom user field called "Doc_Type". (I set it up as a string, not relational). If I select a file wherein the "Doc_Type" field is empty, and use the "Rename, Move, & Copy Files" dialog box, and use the expression editor to enter the following:

isempty([Doc_Type], 0)

I would expect to get an output of "1" (indicating that the field is indeed empty), but I don't. The output is "0". What is particularly odd is that if I simply switch the test mode to 1, as in the following:

isempty([Doc_Type], 1)

I get an output of "1". If I run this same test on another field that contains data, I get the same results. Its as if the function is simply returning whatever mode I specify.

Any ideas what is happening here?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Trouble with the IsEmpty(…) Function.
« Reply #1 on: January 31, 2014, 02:36:59 pm »

The RM&C tool treats field evaluation specially:

   http://wiki.jriver.com/index.php/Expression_Language#Field_Values:_Empty.2C_0.2C_and_1

It has to do this so that fields don't just collapse away, leaving a degenerate file or path name.  Imagine Rename working on a folder & file rule: [Artist]\[Album]\[Name].mp3  where Artist, Album and Name are empty: you're left with the string "\\.mp3".

So add ,0 to the end of your field, or compare against the field's display name using IsEqual().
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up