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 / How to save collection...
Power Apps
Unanswered

How to save collection data to Dataverse?

(0) ShareShare
ReportReport
Posted on by 114

In my canvas app, I have a main form, and a secondary form for child records.  When I hit the Add button, the two forms are added to collections using the below formula.  I can add multiple child records with using the same Add button.   

 

Collect(
MainCollection,
{
Name: DataCardValue3_1.Text,
Fac: DataCardValue19_1.Selected,

}
);

 

Collect(
ChildCollect,
{
Location: DataCardValue9.Selected,
Details: DataCardValue10.Text,
ReqNum: varReqNum.'Request Number'
}
);

 

Once I finish adding, I hit the submit and the following formulas are used.  I used a Set to store the main record in a variable (varReqNum) so I can get the record ID to use for the child record. 

 

ClearCollect(
MainCollection,
Set(
varReqNum,
Patch(
'Access Control Main Forms',
Defaults('Access Control Main Forms'),
{
FirstName: DataCardValue3_1.Text,
Facility: DataCardValue19_1.Selected,
}
)
)
);

 

All seems ok up to this point where I want to patch the child records:

 

ClearCollect(
ChildCollect,
ForAll(
ChildCollect,
Patch(
'Access Control Details',
Defaults('Access Control Details'),
{
Location: DataCardValue9.Selected,
Details: DataCardValue10.Text,
'Access Details': testvar.'Request Number'
}
)
)
);

 

It patches fine but they are repeating records and It's because im using the datcardvalue from the child form and not the childcollection.  How would I go about referencing the child records in the collection to patch into my dataverse?  

Categories:

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 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard