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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,524)