cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RArmstrong
Level: Power Up

Using the first letter a string in another variable.

Hi All,

 

I am pulling data from an SQL database to create AD users.
I have basic fields like first name, last name etc.

What I need to achieve is using the first letter of the users first name added to the last name to make a user name. 

 

For example

The fields "Robert" & "Armstrong"

becomes RArmstrong@somedomain.com

 

Any ideas?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Using the first letter a string in another variable.

Sorry, been a long day.
concat(substring(variables('FirstName'),0,1),variables('LastName'))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Using the first letter a string in another variable.

Here's the formula to use.  Just replace FirstName and LastName with the appropraiate data fields from dynamic content



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
RArmstrong
Level: Power Up

Re: Using the first letter a string in another variable.

Hi @Pstork1 

Thanks for the reply but I think I am missing something.

There is no formula in your reply?

Dual Super User
Dual Super User

Re: Using the first letter a string in another variable.

Sorry, been a long day.
concat(substring(variables('FirstName'),0,1),variables('LastName'))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

RArmstrong
Level: Power Up

Re: Using the first letter a string in another variable.

Thanks @Pstork1,

That worked but now I am getting the following error 

Capture.PNG 

Community Support Team
Community Support Team

Re: Using the first letter a string in another variable.

Hi @RArmstrong ,

 

The function you are using should work.

 

From the screenshot, it seems that you have 57 apply to each items.

 

Please check other items to see if the error happens on certain item.

 

Best regards,

Mabel          

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dual Super User
Dual Super User

Re: Using the first letter a string in another variable.

Click on the Next failed link to find out which step failed.  I would suspect its probably that some of the records have null fields for First or Last name.  You could adjust the formula to check for that.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,344)