Hello everyone, is there a way that i can click a button to assign based on logged in user?
i can get the default logged in user to work but cant get it to work when you click on a button (i would rather not have it default)
i have a people picker field called 'Approved by",
does anyone know how to get it to work that if you press the button it will update the 'Approved by:" to the current logged in user?
what i am using for logged in user
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName:User().FullName,
Claims:"i:0#.f|membership|" & Lower(User().Email),
Department:"",
Email:User().Email,
JobTitle:"",
Picture:""
}
Solved! Go to Solution.
No problem!
I am not sure how your status factors into any of this or if you are just providing as reference, but for your original question...
On the Button OnSelect action, set the following formula:
With(User(),
UpdateContext({lclUser:
{ Claims:"i:0#.f|membership|" & Lower(Email),
DisplayName: FullName,
Department:"",
Email: Email,
JobTitle:"",
Picture:""
}
})
)
Then in the DefaultSelectedItems property of your combobox, set to the following:
lclUser
I should have also asked if you already have a DefaultSelectedItems property!! If so, then change the formula to:
Coalesce(lclUser, <yourCurrentDSIformulaHere>)
Just remember to do an UpdateContext({lclUser: Blank()}) at some point...like the screen OnHidden action, or whatever is applicable to your design.
Are you looking to have a combobox reflect the current user when the button is pressed or are you trying to immediately write that value to the datasource?
thank you for your quick reply, i would like it to update the combo box first, i have a separate button for them to hit to update the record, i would actually love to have the one button update a status (dropdown) and the assigned to (people picker) at the same time if possible
What is the Items property of your Combobox (I assume it is a combobox!)
Please let me know what the Items property of the 'Approved by RAD' combobox is.
sorry about that Randy,
People Picker - ITEM = "Choices('Protocol Change Intake'.'Approved by RAD')"
RAD Status - ITEM = "Choices('Protocol Change Intake'.'RAD Status')"
thanks for your help with this, very much appreciate it
No problem!
I am not sure how your status factors into any of this or if you are just providing as reference, but for your original question...
On the Button OnSelect action, set the following formula:
With(User(),
UpdateContext({lclUser:
{ Claims:"i:0#.f|membership|" & Lower(Email),
DisplayName: FullName,
Department:"",
Email: Email,
JobTitle:"",
Picture:""
}
})
)
Then in the DefaultSelectedItems property of your combobox, set to the following:
lclUser
I should have also asked if you already have a DefaultSelectedItems property!! If so, then change the formula to:
Coalesce(lclUser, <yourCurrentDSIformulaHere>)
Just remember to do an UpdateContext({lclUser: Blank()}) at some point...like the screen OnHidden action, or whatever is applicable to your design.
Hello Randy, that worked like a charm, thanks so much,
what does the UpdateContext({lclUser: Blank()}) do?
and do i add it to the screen OnHidden action?
does it reset the variable?
thanks again.
User | Count |
---|---|
253 | |
109 | |
92 | |
48 | |
37 |