Hi All,
I have been trying to create a user form. I have a Field Named CREATED_BY different from default ("CREATED BY") . I aware That "CREATED BY" will give the Author Name but i need only the UserID for my CREATED_BY field. I tried applying User().Email function in default property of my CREATED_BY and i found that Email contains the Userid + company domain eg(AABBCCDD@XYZ.COM)
I want AABBCCDD as value for my CREATED_BY field. CREATED_BY field will be not visible to the user in the user form which i designed it . so the value should be default and reflected in sharepoint list.
Sharepoint list
CREATED_BY field
Solved! Go to Solution.
@rohitsekar1996 , Use below formula to get the UserID from User().Email:
First(Split(User().Email, "@")).Result
Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it 👍.
You could obtain the Username like this.
First(Split("yourname@yourcompany.com", "@")).Result // will return "yourname"
Therefore this would work too:
First(Split(User().Email, "@")).Result
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Thanks for the Reply, How to make this value a Default Value so User Cant change this Value in Userform.
Set the field to the read version in form fields or unlock the card and make the displaymode to view. Then set the update property to the above formula given. Also you can update the default property to same formula as well.
@rohitsekar1996 , Use below formula to get the UserID from User().Email:
First(Split(User().Email, "@")).Result
Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it 👍.
I found an issue whereby the User().Email may not return a value which matches the User ID value you might expect. This is particularly true for users with multiple registered SMTP values (these can be seen using Outlook client's Address Book search and then viewing the "E-mail Addresses" tab of the contact card). This is a big gotcha for our company because we have quite a few users with multiple registered SMTP values, many of which have local-parts (the part before the '@') which do not match their user principal name. My account is one of those. To get around this possibility for mismatch, I turned to the true user identifier (a GUID). To get that, I used the Microsoft365Users connector with the following formula:
Microsoft365Users.MyProfileV2({'$select':"id"}).id
This returns the UserId of the current user (a GUID as text).
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
191 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
263 | |
86 | |
71 | |
69 | |
66 |