Hi @Salesforce ,
An Edit form will only have one data source and the record it bond to is set in the Item property. Only controls those are within the form could use other data sources.
As this form is bonding to the Submitlist where includes an AssignedTo person column, there should be a Data Card links to this column in the form. So you need to add a custom Card for this form, place it above the AssignedTo Card , add a Combo box in it then set the Items as below to let users select roles:
["Approver", "Implementer", "Rejecter", "Admin"]
Once the role is selected, the AssignedTo Combo box Items:
Switch(
AssignedRoleComboBox.Selected.Value,
"Approver",
Distinct(
Rolelist,Approver.DisplayName
).Result,
"Implementer",
Distinct(
Rolelist,Implementer.DisplayName
).Result,
"Rejecter",
Distinct(
Rolelist,Rejecter.DisplayName
).Result,
"OtherRole",
Distinct(
Rolelist,OtherRole.DisplayName
).Result
)
AssignedRoleComboBox is the Combo box within the custom Card.
At last, you need to change Update of the AssignedTo Data Card to
{
Claims: "i:0#.f|membership|" & Lower(First(Office365Users.SearchUserV2({searchTerm:AssignedToComboBox.Selected.Result}).value).Mail),
Department: "",
DisplayName: AssignedToComboBox.Selected.Result,
Email: Lower(First(Office365Users.SearchUserV2({searchTerm:AssignedToComboBox.Selected.Result}).value).Mail),
JobTitle: "",
Picture: ""
}
Actually, the best approach will be adding an "AssignedRole" Choice column in the SubmitList, so users could select the roles in this list, and you will not need a custom Card to hold those hard-coded roles in the Combo box.
Hope this helps.
Best regards,