cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
samsam
Advocate II
Advocate II

Automatically assign current User ID/email to Sharelist list

Hi, 

 

I would like to assign the current user email/name to a comboBox of SharePoint List with 'Person and Group' type

I tried the below command, but it returns error.

 

May I know how can I assign the current user id to that field automatically?

 

Q25a.PNG

 

Thanks in advance


Sam

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @samsam ,

Do you mean you want to set current user to the staff name field automatically?

You have to modify the DefaultSelectedItems property of combo box as below:

 

{
Claims:"i:0#.f|membership|" & User().Email,
Department:"",
DisplayName: User().FullName,
Email: "",
JobTitle:"",
Picture:""
}

 

Sik

View solution in original post

3 REPLIES 3
poweractivate
Super User II
Super User II

@samsam 

We believe you get this error because Choices is not looking for a condition, it is looking for a column. In other words, looking for records where the data source StaffName column is equal to the current user full name is probably not a valid type of column, that needs to likely be put not as direct parameter of Choices. but rather be put somewhere else.

v-siky-msft
Community Support
Community Support

Hi @samsam ,

Do you mean you want to set current user to the staff name field automatically?

You have to modify the DefaultSelectedItems property of combo box as below:

 

{
Claims:"i:0#.f|membership|" & User().Email,
Department:"",
DisplayName: User().FullName,
Email: "",
JobTitle:"",
Picture:""
}

 

Sik

View solution in original post

@v-siky-msft Thank you ~ it works perfectly

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (17,693)