Hi all,
I need to set as default a specific user (Person field in Sharepoint) in a choices field in my approvals power app.
Until now, the field searches for all company's Office 365 users, but I need to change it in order to set a specific person as approver.
Any help would be greatly appreciated.
Solved! Go to Solution.
So, the better choice is to have a Person Column in your list. Then in your EditForm, you can simply add that field to it and everything will already be set for you.
The only thing you will need to do then is to set the DisplayMode of the control based on if there is a person assigned or not.
If(IsBlank(Parent.Default), Edit, Disabled)
If you are using Office365 for your user records in your combobox (assuming combobox) then you will need to convert to a SharePoint user record.
However, I am not clear on what you mean by "set as default"? Can you expand on that more and your scenario?
Hello @RandyHayes ,
Yes, I mean I want to lock the field (DisplayMode.Disabled), so that users will not be able to change the approver Person (meaning the user I will have already set as approver).
Example:
I could just write the approver's name, but I need the whole user's record (to use it later in a flow)
So, if you already have a value in that column and you just don't want it to change, then set the DisplayMode property of the control to evaluate the fact that there is already a value.
A couple of questions:
1) Is this in an EditForm or freestanding?
2) What is the DefaultSelectedItems property of the control?
It is in an edit form.
Well, that is actually my question. I tried to use DefaultSelectedItems like this: { Value: "Name Lastname" }
which is obviously wrong. I don't know what I should put there since it is a record... Where do I get that info? Should I use the email of the approver or something else?
So you have two questions then? - 1: how to set the DefaultSelectedItems and 2: how to make it disabled if it has a value
If so, then the next question is...why are you using Office 365 in the Items property of the combobox? Is there a specific need for that source rather than the traditional SharePoint person column choices?
I use the Sharepoint person column choices because, until recently, users could select their approver. There was no 'default' approver, it could be any user. I guess that now I can create a new approver text field and delete the old one.
So, the better choice is to have a Person Column in your list. Then in your EditForm, you can simply add that field to it and everything will already be set for you.
The only thing you will need to do then is to set the DisplayMode of the control based on if there is a person assigned or not.
If(IsBlank(Parent.Default), Edit, Disabled)
User | Count |
---|---|
159 | |
85 | |
68 | |
63 | |
61 |
User | Count |
---|---|
209 | |
151 | |
93 | |
81 | |
69 |