Folks,
Need little help for variables.
I have a SharePoint list with columns First name, last name, Middle name. Trying to create user in Azure AD uses first name initial, Middle name Initial and last name @Anonymous.com (i use compose for ubstring(triggerBody()?['First_x0020_Name'],0,1)) for upn.
Issue would be if user doesn’t or have middle name. How can create user to put in UPN action in create user.
I was thinking initialize variable on both compose (first, middle)and give same variable name so I can use under user principal name in create user. What are you guys thought?
ok at 12:18 am finally it is working..here what I did, I know there would be other way to do it, but I just don't want to deal anymore.
To simplify, I created three compose
1. substring(triggerBody()?['First_x0020_Name'],0,1)
2. concat(outputs('ComposeFirstNameInit'),triggerBody()?['Last_x0020_Name'])
3. if(empty(triggerBody()?['Middle_x0020_Initial']),outputs('ComposeFlastname'),concat(outputs('ComposeFirstNameInit'),substring(triggerBody()?['Middle_x0020_Initial'],0,1),triggerBody()?['Last_x0020_Name']))
Working fine now..
ok said it earlier
so I have added as below
Compose-LenghtFirstname
Hi @usarif
Thanks for the screenshot.
It's difficult to debug via expression. So what I would suggest is add three different compose statements. Map firstname, middlename and lastname in each compose. Next add another three compose and add expression length for each compose from the above (firstname, middlename and lastname). Then run your flow and check the run history. This will reveal what exactly parsing under the expression statement. Once all fixed then you can remove all these compose statements. Hope it make sense.
Thanks
here you go...
Hi,
Could you please post a screen shot of your flow and run history?
Thanks
Hi @usarif
Try this in a compose statement as expression
if(empty(triggerBody()?['Middle_x0020_Name']),concat(triggerBody()?['First_x0020_Name'],triggerBody()?['Last_x0020_Name']),concat(triggerBody()?['First_x0020_Name'],triggerBody()?['Middle_x0020_Name'],triggerBody()?['Last_x0020_Name']))
this is what i am putting under ComposeMiddleExist
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2