Developer forum

Forum » CMS - Standard features » Assign user to group on Form submit

Assign user to group on Form submit

Adrian Ursu
Adrian Ursu
Reply

Hi guys, 

I am using Forms for editors on DW 9.6.3 and I need to assign a user to a group upon form submit.

The user is authenticated, fills out the form (which has Name and Email mapped correctly to user properties) and my expectation would be to assign the user to a group specified in the Paragraph settings.

According to the documentation, if the "Create user on form submit" is checked and a group selected, it should assign the existing user to the group and set Email permissions to true. I don;t need the Email permission check but I need the group assignment.

In my situation it does not happen.

I have checked the template tags rendered for the form and they don't contain any mention of the UserGroup.

What am I doing wrong?

Thank you,
Adrian 

Replies

 
Nicolai Pedersen
Nicolai Pedersen
Reply

The feature is called "Create user on form submit" - meaning it will create a user. You want to update a user...? But overwrite name and email fields? That is not supported by forms.

But why use a forms for editor for that? The user is already logged in - so you would make an edit profile with options - i.e. which groups they should be member of etc.

 
Adrian Ursu
Adrian Ursu
Reply

Hi Nicolai,

Based on the documentation here: https://doc.dynamicweb.com/documentation-9/content/apps/forms-for-editors I should be able to assign the user to a group (if I understand the explanation correctly):

  • If the email corresponds to an existing user, only the email permission field and group membership is updated. This makes it possible to sign existing users up for newsletters. You cannot update other fields this way - use the Extranet app.

I don't want to edit the email nor the Name. I just want to assign the user to a new group, ask for some Consents and send a notification to the Admin of the site (because the Admin will have to perform a task afterward)

The extranet will allow assigning the user to a group, and maybe collecting a consent. But it will not allow sending the notification to the admin.

What am I missing?

Adrian

 
Nicolai Pedersen
Nicolai Pedersen
Reply

That is related to the same (anonymous) user (that would be email address) is submitting the same form where the "Yes I want newsletter" checkbox. Not sure the group code runs without the email permissions set as it is meant for users signing up to newsletters when they are already in the userdatabase.

But in order for that to work, you might have not defined the email field on the form? Using the autovalue is not enough - you also need to choose the email field under the settings for the form. Try to check that and see if it then works without the email permission field.

 
Adrian Ursu
Adrian Ursu
Reply

Hi Nicolai,

Email is already set. I also get the confirmation email once I submit the form.

I don't mind if the Email permission will be checked. My main concern is the allocation to the Group and it does not seem to work.

Adrian

 
Adrian Ursu
Adrian Ursu
Reply

Hi Nicolai,

Anything else on this topic?

Thank you,
Adrian

 
Nicolai Pedersen
Nicolai Pedersen
Reply

Nope - discussed this with another partner last week, and will do something in order to be able to create a user 2 times, but not more.

Until then, create a flow like this

Create profile

  1. Enter Email: np@dynamicweb.dk, press "next"
  2. Yeah, you already have a profile - go to login or rest your password here <- link to reset password page
    or
  3. Please enter your name etc.

This happens even on Facebook...

 
Adrian Ursu
Adrian Ursu
Reply

Hi Nicolai,

Thank you very much for your answer. 

Is not my use case, but at least I know I should find a different solution.

In my situation, a user needs to fill out a form in order to request an upgrade of his level. The upgrade of the level would be performed manually by an admin. But in order to ease the work of the admin, upon completion of that Form, I would assign the user to a "requested Upgrade" User group. This way, the admin can go in the folder and decide who should be upgraded.

I wanted to use Forms for editors for this purpose because I also want to capture some comments from the user requesting the upgrade as well as some uploaded files backing the request. I cannot use the Extranet for this purpose because of the above reasons.

That's why I was hoping that the "Create user on submit" would do the job. At least that was my understanding of the feature description.

If that's not possible, I will have to find other ways to handle this feature.  

Thank you,

Adrian

 

You must be logged in to post in the forum