Create a user account for someone without updating fields

Hello everyone,

I didn’t find my exact answer in the forum so I am trying in a dedicated post.

I am using “Create an account for someone else” as first action in a workflow. My issue is that if the user exists then I get the user (perfect) BUT the fields are still updated ! I don’t want the user to change the fields of an existing account if it exists.

I simply don’t get why the fields gets updated with “Create an account for someone else” if the user exists, for me it makes no sense. And I need to specify the 2 fields first name/name in the action because otherwise the account would be created with empty values.

My ideal scenario would be:
– User exists ?
---- If YES → then refer to existing account
---- If NO → then create the account with all fields (first name, last name, email) → then refer to account just created

Can anyone help me there ? :slight_smile:

1 Like

Just adding one information, I tried searching for existing user first but as user emails are private, the current user can’t make the search.

If it can help :slight_smile:

When you say

You want to reference a specific user in a workflow but not have any access to their data (since you say privacy rules don’t allow users to see other users)?

Is this something you can run as a backend workflow? Then you can check the box to ignore privacy rules and you can have the conditional searching for existing users to do the check that you want.

You could use “Create an account for someone else” with returning existing users, but don’t add any fields yet on that workflow. Then just add another “make changes to user” workflow after that makes a change to the newly created user if a certain field on that user (result of step 1’s field) is empty. Not sure what fields you are saving, but you could, for example, say that if the user returned from “Create an account for someone else” doesn’t have a name, then make changes to them. Or you could even add a new user yes/no field such as “fields edited.” That way, existing users don’t get updated in the workflow.

Make sense?

Yes that’s the case. I need to create the user if it doesn’t exists and filling some fields, and if it exists I just need to get it returned.

I can create a backend workflow but then I don’t understand how I could synchronize my front flow. As an example, I created a backend workflow to check if a user exists but we can’t really use “return of this backend workflow” in a standard workflow :confused:

Hey ! that makes totally sense, I have tested it and unfortunately, as my user doesn’t has access to private data (user data) the answer of user field is empty always return “empty” :confused:

You can actually make an API call to your app using the API Connector plugin as if it is an external application, then you can send up your workflow to just return the User’s unique id or something.

You’ll need to setup an API key in your app settings to authenticate it, then in your workflow do the Return data from API action

Hello ! I have found a way and mixed the solutions provided here :slight_smile:

I have created two workflows.

Workflow associated to button click

  1. “Define a custom state” to the page to value “X”
  2. “Create an account for someone else” (user is not returned if account exists to trigger an error + no changes to the user fields) → if user does exists fields are not updated, an error is triggered and workflow interrupted
  3. “Make changes to thing” (return of step 2, the fields I need to update)
  4. Suite of the workflow

Workflow “when an unhandled error occurs” that catches an element workflow error. Only when = “current workflow error” = “USED_EMAIL” AND “page custom state” = “X”

  1. “Create an account for someone else” (user is returned if account exists and I know at this stage it exists)
  2. Suite of the workflow without make “changes to a thing”

I have added the custom state because I want the second workflow to only trigger because of this specific error and context ; because I may need to catch this error in a different context.

Does that makes sense ?

Thank you for you help here :pray:

I took the time to describe the solution because I made a lot of search before posted and didn’t find a proper solution :slight_smile:

2 Likes