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 / I want my submitform t...
Power Apps
Unanswered

I want my submitform to save to a collection instead of the original datasource

(0) ShareShare
ReportReport
Posted on by 53

Hello

 

How would I save my form to a collection instead of back to the original datasource?

 

I tried collect(exampleCollection,submitform(form1)); and it doesn't seem to work. Any other methods?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @noneother ,

    You cannot display an item from a collection on a form, however this will get you all the fields on the form that have been changed

    ClearCollect(colForm,YourFormName.Updates)

    Or you could simply code it all

    ClearCollect(
     colForm,
     {
     Field1Name:FormControl1.xxxx
     Field2Name:FormControl2.xxxx
     Field3Name:FormControl3.xxxx
     }
    )

    the xxxx is what ever valid value refers to the control content.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • noneother Profile Picture
    53 on at

    This doesn't seem to work for me, below. I want to simultaneously save to a collection then save that collection to the respective record within a SharePoint list. Any clues?

     

    ClearCollect(ColForm1Form2,{Col_ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text, 'Activity Notes': DataCardValue25.Text});
    
    ForAll(
     ColForm1Form2,
     Patch(
     LookUp('Consumer Sample for Survey FINAL', Col_ACMPS_CARE_RECIPIENT_ID = ACMPS_CARE_RECIPIENT_ID),
     {
    
    'Activity Notes': ColForm1Form2[@'Activity Notes']
    
     }
     )
    );

     

  • noneother Profile Picture
    53 on at

    Nevermind. I saw I was missing: the source before Lookup

     

     

    ClearCollect(ColForm1Form2,{ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text, 'Activity Notes': DataCardValue25.Text});
    
    ForAll(
     ColForm1Form2,
     Patch(
     'Consumer Sample for Survey FINAL', LookUp('Consumer Sample for Survey FINAL', ColForm1Form2[@ACMPS_CARE_RECIPIENT_ID] = ACMPS_CARE_RECIPIENT_ID),
     {
    
    'Activity Notes': ColForm1Form2[@'Activity Notes']
    
     }
     )
    );

     

  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @noneother ,

    Are you waiting to also retain all the notes in the collection?

    You need to firstly initiate it - App OnStart would work - this will give you an empty collection with the required fields

    ClearCollect(
     ColForm1Form2,
     {'Consumer Sample for Survey FINAL':""|,
     {'Activity Notes': ""}
    );
    Clear(ColForm1Form)

    Then you can collect all the form inputs

    Collect(
     ColForm1Form2,
     {
     ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text, 
     'Activity Notes': DataCardValue25.Text
     }
    )

    Then when you want to write it all back

    ForAll(
     RenameColumns(
     ColForm1Form2,
     "ACMPS_CARE_RECIPIENT_ID"
     "ACMPS_ID"
     "Activity Notes",
     "Activity",
     ),
     Patch(
     'Consumer Sample for Survey FINAL', 
     {ACMPS_CARE_RECIPIENT_ID:ACMPS_ID};
     {'Activity Notes':Activity]
     )
    )

    Is this what you want to do - or do you want to write each, but store in a collection as well? The first bit (OnStart) and the collection would be the same. The Patch would be

    Patch(
     'Consumer Sample for Survey FINAL', 
     {ACMPS_CARE_RECIPIENT_ID: DataCardValue146.Text},
     {'Activity Notes': DataCardValue25.Text}
    )

    or

    UpdateIf(
     'Consumer Sample for Survey FINAL', 
     ACMPS_CARE_RECIPIENT_ID=DataCardValue146.Text,
     {'Activity Notes': DataCardValue25.Text}
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @noneother ,

    It seems that you've solve your problem, am I right?
    If so, do you have any other problem?

    If not, could you change your issue's status to "Answered"?

    Thanks!

     

     

    Best regards,

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 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard