cancel
Showing results for 
Search instead for 
Did you mean: 

Allow Collections to be used as a DataSource in Forms

Collections do not show up in the list of datasources when you create a display or edit form, but you can manually type in a collection name in the formula bar. However, even though this is accepted, you cannot then add fields based on the collection you have entered. The "edit fields" tab doesn't even allow you to add a custom datacard.

 

Can we get support for collections to be used in forms like they are in galleries and data tables?

Status: New
Comments
Microsoft

Make a DataSource a type of collection. In other words, enable mirroring of a collection with what is now a DataSource, and make all the syncing automatic. Give it a boolean property "Online". It can be hard set to true to behave how a DataSource does now, but will read false when connection is lost. It can be hard set to false to only sync when Refresh is called. Setting it to a variable, or a more complex expression, will allow the program to change modes programmatically.

Kudo Kingpin

@sopatte I'm not sure how that is relevant to this idea. 

Helper I

I am using a collection with an edit form (manually created and binded the data fields) and interestingly it seems to work for some of my data fields and not others. 

 

Having the ability to bind a collection to a form would be very useful. My use case is an app with offline functionality so when connected, it points directly to the data source and when offline it points to the collection. 


Edit:
I found the reason it was working with some columns but not others is because of a separate bug with the Patch() function on local collections with NULL fields where it can not update the field.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-Collection-not-Updating-Blank-Columns/... 

It appears the forms emulate this behavior when they submit data. 

Kudo Kingpin

This issue can be worked around relatively easily if you are using a collection which is just a replica of a CDS entity, since you can just build the form based on the entity and then swap the datasource to the collection.
But there is not a good workaround to quickly creating a form if you have manually created a collection which you want to edit.