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 / Add Collections as Dat...
Power Apps
Unanswered

Add Collections as Data Source for New Form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I created my Collection, Names, as one record.  The record has FirstName and LastName.  I want to add a new form. Then do ClearCollect to add that one record.  I added my form.  I added the DataSource of Names (Collection).  It does not give me the fields or layout for either a new or edit form.  I want to add the fields to my form to add to the collection.

Thanks for your help

Categories:
I have the same question (0)
  • tly Profile Picture
    400 on at

    I'm not quite understanding what you are attempting to do, but my guess is that you are trying to use a PowerApps form to append to a temporary, in-memory collection (let's call this a dynamic collection). I haven't tried this, but I know traditionally you use a form to submit to a datasource's (for lack of better word) data source (e.g. Excel, SQL, SharePoint List, etc.). If it's failing, it's probably because the PowerApps form object wasn't intended to collect data into a dynamic collection.

     

    What you can do is use a Collect command to append new records into your Names collection. For example, within a button's OnSelect property, you can do something like this:

    Collect(nameCollection,
     Table(
    {
    FirstName: firstNameTextBox.text,
    LastName: lastNameTextBox.text
    }
    ) )

    Now that I think about it, you don't have to scrap your form. Where my example says firstNameTextBox.text, you can just point it to DataCardValueXX.text. If you keep the form, you may want to consider resetting the form after collecting.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have added the collection with the OnSelect.  Now I'm trying to read that Collection.  It is not appearing in my Data Source.  I can create the Data Source but how do I make a Collection record appear on the screen.

    Ex. Form 1 - Collect the data

    Form 2 - Display or Edit the data that was collected. 

    Form 2 is where I am having problems.

    Thanks.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous,

    Tommy is quite right about forms and collections.  Forms are designed to work directly with the underlying datasources in the app.  While you can put a collection in as a datasource, the form will not save data to the collection and it won't display the fields like it does when the datasource is an excel or sql table, a sharepoint list or a CDS entitiy. Trying to make a form do something it is not designed to do will lead to alot of wasted effort and frustration.  Collections exist only in memory and they can be created, shaped and manipulated with a variety of functions but unless they are saved to a permanent datasource, the data they contain will not be retained once the app is closed.   If you want to display the data in a collection, you can use a gallery or data table. Please take 20 minutes to review Shane Young's  @Shanescows YouTube video on Collections at https://www.youtube.com/watch?v=yS6mTRlmuls.  It will save you lots of time once you understand how to work with them.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Let me start again.

    Both file 1 and file 2 are in SharePoint.

    I want to read a file1 from SharePoint and display it in a gallery.  The person can pick one record in the gallery. 

    From there it goes to a new form where I display the previous title from file1 which also is in file2.  I want to take the title and the rest of the information entered and store it in file2 in SharePoint.

    I tried a lookup from file2 to file1.  It works but there are too many records to scroll through.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard