web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

undefined

(0) ShareShare
ReportReport
Posted on by 2

Hi,

1. I have a SPList as 'Dates'. I have a column in 'Dates' list as TrainerName and need to save this TrainerName in Person/Groups column of my SP list. So, I have a Gallery9 where it shows columns from 'Dates' list and I am selecting the TrainerName from Dropdown4 of Gallery9. So, If I am using below formula to patch the TrainerName(Person/Group column)it is showing error.

ForAll(Gallery9.AllItems,If(!IsBlank(LookUp(Dates, Title = Label135.Text And Date = Value(Label167.Text))),UpdateIf(Dates, Title = Label135.Text And Date = Value(Label167.Text),{​​​​​​​TrainerName: Dropdown4.Selected.Title}​​​​​​​),Patch(Dates, Defaults(Dates), {​​​​​​​TrainerName: Dropdown4.Selected.Title}​​​​​​​)));

2. On clicking the update button, email has to be sent to the assigned trainers from the gallery. Now as shown in this screenshot, I have 3 trainers assigned. Now the email should include start date, end date and time mentioned in the gallery

( for 1) PreethiAdavelli - 9/2/2021, 9/3/2021, Start Time : 9:00 AM End Time : 18:00PM
2) KolaMounika - 9/6/2021, 9/7/2021, Start Time : 9:00 AM End Time : 18:00PM
3) KunaRamya - 9/8/2021 , 9/9/2021, 9/10/2021, 9/11/2021, 9/12/2021, 9/13/2021 Start Time : 9:00 AM End Time : 18:00PM ). 
So how can I send email to these assigned trainers with particular Start Date, End Date, Start Time and End Time.PreethiReddy_Ad_0-1631164550849.jpeg

 

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @PreethiReddy_Ad :

    Q1:I have a SPList as 'Dates'. I have a column in 'Dates' ……

    Updating the person type field needs to comply with certain rules,I think this link will help you a lot:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Person-column-and-SubmitForm/td-p/549235

    On your side the code should be:

    ForAll(
     Gallery9.AllItems As Source,
     With({
     ThePerson:With({
     ThePersonDetail:First(Office365Users.SearchUserV2({searchTerm:Source[@Dropdown4].Selected.Title}).value)},
     {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|" & ThePersonDetail.Mail,
     DisplayName: ThePersonDetail.DisplayName,
     Email: ThePersonDetail.Mail,
     Department: 
     ThePersonDetail.Department,
     JobTitle:ThePersonDetail.JobTitle,
     Picture:""
     }
     )
     },
     If(
     !IsBlank(LookUp(Dates, Title = Source[@Label135].Text And Date = Value(Source[@Label167].Text))),
     UpdateIf(Dates, Title = Source[@Label135].Text And Date = Value(Source[@Label167].Text),{​​​​​​​TrainerName:ThePerson}​​​​​​​),
     Patch(Dates, Defaults(Dates), {​​​​​​​TrainerName: ThePerson}​​​​​​​)
     )
     )
    );

    In addition,I'm not sure if this code will work

    vbofengmsft_0-1631589657968.png

    Could you tell me:

    • What is Date?What is it's data type?Could show me a demo of your data source?
    • What is label167?

    Q2:On clicking the update button, email has to be sent to the as……

    Regarding your second question, I suggest you provide the detailed settings of the gallery and a demo of the data source, otherwise we cannot provide effective suggestions.

    In addition,usually we suggest that one thread to solve one problem, I suggest you consider creating a new thread for this problem.

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard