assignUserInProfile is returning error 'user is not valid'

assignUserInProfile is returning error 'user is not valid'

Hi,

Can anyone help with this error.
I am using assignUserProfile in a Form for the customer to add Users to their App. However, it is returning the same error 'user is not valid'.

I have set the output as a variable to capture in a Form field TXT_profile, but clearly it captures nothing.

var = thisapp.permissions.assignUserInProfile(input.New_user,"Write",TRUE);
TXT_profile = var;

I have tested in both Stage and Production environments and its the same problem.

I am not a seasoned programmer, so I use Deluge only when no other way is possible. 

Thanks for any pointers
Karen