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 Platform Community / Forums / Power Apps / Patching D365 record
Power Apps
Answered

Patching D365 record

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello guys, I need help with a simple thing I'm not sure about.
I have a Canvas Power App where I have a gallery, I have added a checkbox to the gallery, the user selects which records they want and clicking the button creates those records.

 

I made OnSelect property of checkbox to Collect(SelectedItems;ThisItem)

And button OnSelect property as:

 

 

ForAll(
 SelectedItems;
 Collect(
 'Contacts';
 Defaults('Contacts');
 {
 "Full Name":Fullname;
 "First Name":Firstname;
 }
 )
);
ClearCollect(SelectedItems, {})

 

 

 It actually doesnt work for me, I also tried through Power Automate and with PowerApps Trigger then PowerAppsFlow.Run(SelectedItems) but Im not sure how to map the fields in Automate I can see only Ask in PowerApps.

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Anonymous ,

    The expression is not making sense because if you’re trying to create a record in Dynamics based on selected records (presumably from a different table), you should be using a Patch instead of Collect.

     

     

    Patch(
     'Contacts',
     ForAll(
     SelectedItems,
     {
     'Full Name': FullName,
     'First Name': FirstName
     }
     )
    )

     

     

    Please modify the above example based on your region.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution

    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Amik Yeah, you're right, thank you so much for your help. Could you help me with one more thing, please?

    I need to map a few lookup fields. For example a field Owner which is a lookup to the Users table in D365, I need to put logged user in that field. I tried this option, but it does not work for me (error invalid argument type (table). expecting a record value instead), do you know where am I doing mistake?

     

    Owner: User().FullName;

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Anonymous ,

     

    Has your initial question been resolved? If yes, please accept the solution to help others who may have a similar question.

     

    You should ideally raise the new question in a separate thread. For the same reason above, we want to enrich forum with as many topics, questions, and answers as possible.

     

    Back to the question, as I understand it, are you trying to Patch a D365 lookup field with the name of the current user?

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard