10

I would like to use the rules engine to prepopulate a WFFM form field with the logged in user's username. Unfortunately, I can't seem to get this to work, even though the conditions and actions that I am using are provided out of the box.

I don't see any errors in my logs or at runtime - the field value is just not being set.

If you look at the below screenshot of the form designer, the rule that I am using is at the bottom left.

enter image description here

Does anyone know what I'm doing wrong here or if there is something special that I need to do in order to get this working?

  • Are you sure the field that you need is UserName? Can you check (with a debugger or so) which fields you have in your profile and whether UserName is filled? – Gatogordo Oct 11 '16 at 21:31
  • UserName is the out of the box property on the UserProfile that contains the username. I can't check with a debugger, as I don't have access to ReSharper or Reflector on the machine that I'm currently working from. – Zachary Kniebel Oct 11 '16 at 21:36
5

Based on this blog post the only valid options are Comment, Name and Full Name. You can try changing your value from User Name to Full Name but I'm not sure if it will give you what you need. You may need to create a very simple custom field for this, or alternatively create a custom rule action as per the linked article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.