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

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
Pstork1
Dual Super User III
Dual Super User III

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
Pstork1
Dual Super User III
Dual Super User III

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.

Hi @Pstork1 

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

There is no formula in your reply?

Pstork1
Dual Super User III
Dual Super User III

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

Thanks @Pstork1,

That worked but now I am getting the following error 

Capture.PNG 

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.
Pstork1
Dual Super User III
Dual Super User III

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,045)