Hi,
I'm building a flow to create an account for new students triggered by a form. It creates a UPN like this: "first_name.last_name@school.com".
Suppose John Doe is a student. He has the UPN "John.Doe@school.com".
Next, suppose a new student has the same name. He needs a unique UPN: "John.Doe2@school.com".
In order to do this, I have Power Automate Search for users (V2) with the UPN as the search term.
Then, I Initialize a viariable, being the integer 1.
Then, a Condition should check whether the UPN already exists in the SharePoint list with students. If it doesn't, it should create the first type of UPN (i.e. "John.Doe@school.com "). If it does, it should create the alternative UPN by Incrementing the integer 1 variable (i.e. "John.Doe2@school.com ").
This all works fine. The problem is I can't get the condition right. This is what I have as the condition:
[value] of Search for users (V2) contains [UPN]
If yes create alternative UPN
If no create standard UPN
But somehow, the condition always returns true, so it always creates the alternative UPN. And when I set the condition to "does not contain" it creates the standard UPN (obviously) but when I run the flow again to have it create the alternative UPN (since the standard UPN already exists), it simply says "UPN already exists" upon creating the account.
How do I define the proper condition?
Best,
Arjen
Solved! Go to Solution.
Hi @Anonymous ,
Please try the following configuration:
Best Regards,
@Anonymous
TRy to add the condition as :
length(outputofyoursearchaction) greater than 0
Create alternative UPN
Else
Create UPN
Hi @Anonymous ,
Please try the following configuration:
Best Regards,
Now, suppose I would like to create a condition, such that:
- if first_name.last_name@school.com already exists, create first_name.last_name2@school.com
- if first_name.last_name2@school.com already exists, create first_name.last_name3@school.com
- etc.
Seems doable but I'm very new to Power Automate so I'm not sure where to begin.
User | Count |
---|---|
5 | |
5 | |
4 | |
2 | |
2 |