cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrChrisApps
Regular Visitor

SharePoint Person field with multiple Values from Lookup

Hello Community, I have a little problem and hope you have a tip for me.

Scenario:

I have four SharePoint lists.

Employees: All employees are listed here

Areas: All areas are listed here

Assignment: This is where the employees are linked to the areas.

Working: This is where everything comes together

 

Here's the challenge:

When a work is created, in the " Working" list in the "Editor" field, the employees who are assigned to the area should be entered. The field is a "Person and Group" field.

I hope I was so understandable. Is there a way to do it? Thank you for your tips.

Greeting

Chris

 

 

Hallo Community, ich habe ein kleines Problem und hoffe Ihr habt da einen Tipp für mich.

Szenario:

Ich habe vier SharePoint Listen.

Mitarbeiter: Hier sind alle Mitarbeiter aufgelistet

Bereiche: Hier sind alle Bereiche aufgelistet

Zuordnung: Hier werden die Mitarbeiter mit den Bereichen verknüpft.

Arbeiten: Hier kommt alles zusammen

 

Hier jetzt die Herausforderung:

Wenn eine Arbeit erstellt wird, möchte ich, dass in die Liste „Arbeiten“ in das Feld „Bearbeiter“ die Mitarbeiter eingetragen werden, die dem Bereich zugeordnet sind. Das Feld ist ein „Person und Gruppen“ Feld.

Ich hoffe ich war soweit verständlich. Gibt es da eine Möglichkeit? Vielen Dank für eure Tipps.

Gruß

Chris

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @MrChrisApps ,

Could you please share a bit more about the data structure of your Working List and Assignment?

Do you set up the relationship between the Employee and Area within your Assignment List?

Do you want to auto-fill the "Editor" field in your Work item when a specific Area is selected?

 

I assume that there are two LookUp columns (Employee && Area) in your Assignment, which reference values from the Employees List and Areas List separately. And I assume that there is a Choice type column (Area) in your Working List to list all available Area options, is it right?

 

Based on the needs that you mentioned, I think you want to auto-fill the "Editor" field in your created Work item when a specific Area is selected, it it true?

 

I have made a test on my side, please consider take a try with the following workaround:

Go to your Edit form, unblock the "Editor" field data card. Set the DefaultSelectedItems property of the "Editor" person field ComboBox to following:

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser(), DisplayName = LookUp(Assignment, Area.Value = AreaComboBox.Selected.Value).Employee.Value).Mail),
        DisplayName: LookUp(Assignment, Area.Value = AreaComboBox.Selected.Value).Employee.Value,
        Email: LookUp(Office365Users.SearchUser(), DisplayName = LookUp(Assignment, Area.Value = AreaComboBox.Selected.Value).Employee.Value).Mail,
        Department: "",  
        JobTitle: "", 
        Picture: ""
    },
    Parent.Default
)

Note: The AreaComboBox represents the ComboBox within the Area field data card in your Edit form, where you choose the Area option for your current work item, please replace it with actual control name.

 

If one area could match multiple employees, and you have enabled "Allow Multiple selections" option for the "Editor" field in your Working list, please consider modify above formula as below:


If(
    EditForm1.Mode = FormMode.New,
    ForAll(
           Split(Concat(Filter(Assignment, Area.Value = AreaComboBox.Selected.Value), Employee.Value & ";"), ";"),
         {
           Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser(), DisplayName = Result).Mail),
           DisplayName: Result,
           Email: LookUp(Office365Users.SearchUser(), DisplayName = Result).Mail,
           Department: "",  
           JobTitle: "", 
           Picture: ""
         }
    ),
    Parent.Default
)

 

More details about the ForAll function, please check the following article:

ForAll function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @MrChrisApps ,

Could you please share a bit more about the data structure of your Working List and Assignment?

Do you set up the relationship between the Employee and Area within your Assignment List?

Do you want to auto-fill the "Editor" field in your Work item when a specific Area is selected?

 

I assume that there are two LookUp columns (Employee && Area) in your Assignment, which reference values from the Employees List and Areas List separately. And I assume that there is a Choice type column (Area) in your Working List to list all available Area options, is it right?

 

Based on the needs that you mentioned, I think you want to auto-fill the "Editor" field in your created Work item when a specific Area is selected, it it true?

 

I have made a test on my side, please consider take a try with the following workaround:

Go to your Edit form, unblock the "Editor" field data card. Set the DefaultSelectedItems property of the "Editor" person field ComboBox to following:

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser(), DisplayName = LookUp(Assignment, Area.Value = AreaComboBox.Selected.Value).Employee.Value).Mail),
        DisplayName: LookUp(Assignment, Area.Value = AreaComboBox.Selected.Value).Employee.Value,
        Email: LookUp(Office365Users.SearchUser(), DisplayName = LookUp(Assignment, Area.Value = AreaComboBox.Selected.Value).Employee.Value).Mail,
        Department: "",  
        JobTitle: "", 
        Picture: ""
    },
    Parent.Default
)

Note: The AreaComboBox represents the ComboBox within the Area field data card in your Edit form, where you choose the Area option for your current work item, please replace it with actual control name.

 

If one area could match multiple employees, and you have enabled "Allow Multiple selections" option for the "Editor" field in your Working list, please consider modify above formula as below:


If(
    EditForm1.Mode = FormMode.New,
    ForAll(
           Split(Concat(Filter(Assignment, Area.Value = AreaComboBox.Selected.Value), Employee.Value & ";"), ";"),
         {
           Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser(), DisplayName = Result).Mail),
           DisplayName: Result,
           Email: LookUp(Office365Users.SearchUser(), DisplayName = Result).Mail,
           Department: "",  
           JobTitle: "", 
           Picture: ""
         }
    ),
    Parent.Default
)

 

More details about the ForAll function, please check the following article:

ForAll function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-xida-msft,

I apologise for my late response. Unfortunately, I had other problems. I didn't see any e-mail addresses from some of my employees.


Here is something about my structure:


Employee: List has been removed
Areas: Text box (1 column)
Assignment (Set up the map here): Two columns | one column is a "person group" / one column is a lookup on Areas
Working: Subject (text) / Description (text) / Area (lookup to Areas) / Employee assignment (person group) / Contact person (Lookup to Azure AD)

 

In your variant, the field is filled by me and that should not be the case. I would like this to happen automatically and be saved via patch. 


Maybe you have an idea.


Greeting Chris


Hallo @v-xida-msft,


Entschuldige bitte meine späte Antwort. Leider hatte ich andere Probleme. Es wurden mir von einigen Mitarbeiten keine E-Mail-Adressen angezeigt.
Hier noch etwas zu meinem Aufbau:
Mitarbeiter: Liste wurde entfernt
Bereiche: Textfeld (1 Spalte)
Zuordnung (Hier wird die Zuordnung eingerichtet): Zwei Spalten | 1 Spalte ist ein „Person Gruppe“ / 1 Spalte ist ein Lookup auf Bereiche
Arbeiten: Betreffe (Text) / Beschreibung (Text) / Bereich (Lookup auf Bereich) / Mitarbeiter Zuordnung (Person Gruppe) / Ansprechpartner (Lookup aufs Azure AD)

In deiner Variante wird das Feld von mir Ausgefüllt und das soll nicht so sein. Ich hätte gern das dies Automatisch passiert und per Patch gespeichert wird. 


Vielleicht hast du da noch eine Idee
Gruß Chris

 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (344)