cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rheiniluoma
New Member

Search for users (V2) driving a do until loop

Howdy All!

 

Thanks to this forum, I can make individual branch conditions work when a user is found or not with Search for users (V2).

 

What I'm trying to do is build a username based on this rule:

First Initial + Last Name -- fairly common, normal, but occasionally gets collisions - if the username exists:

First Initial + Middle Initial + Last Name -- cool.. can build that and it works :

First Initial + Middle Initial + Last Name 2 -- ok I can do that too...

But then what I really want to do is iterate that number until we no longer have a collision

 

Joe M Smith:

jsmith 

jmsmith

jmsmith2

jmsmith3..4..5..6...

 

So search v2 2 does middle initial last name - works fine, but search 3 is the one that starts adding the number:

rheiniluoma_0-1637695114382.png

 

What I'm trying to do is rerun, the Search For Users 3 with the newly incremented variable, and then recheck.

 

I'm at a loss as to how I'd do this.

 

When I paste it in, I end up creating a new search for users object, instead of reusing the existing one.

1 ACCEPTED SOLUTION

Accepted Solutions
rheiniluoma
New Member

K.. so I figured it out.

I had to set a variable based on the "not found" condition, and then control the loop with the variable.\

 

Inside the loop I had a new lookup that set the variable.

 

View solution in original post

2 REPLIES 2
rheiniluoma
New Member

K.. so I figured it out.

I had to set a variable based on the "not found" condition, and then control the loop with the variable.\

 

Inside the loop I had a new lookup that set the variable.

 

Hi @rheiniluoma 

Thanks for your posting here and sharing the solution in the forum as it would be helpful to anyone who encounters similar issues.

Please consider accepting your reply as an answer if this could solve your problem so that this thread will be marked for other users to easily identify!

Best Regards

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,691)