cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ErinCannon
Helper I
Helper I

SharePoint, Collections and Forms Issue

Lately I have had issues with Forms not working when the Item is pulling from a connection.  For Example:

 

I have an app that has a caching mode for offline use.  Since I want the users to still be able to see / edit the items that they have added but are not uploaded to SharePoint yet, I have the galleries/tables set to display collections.  The collections are created by a formula like this: ClearCollect(InventoryList, Filter('Inventory List', StructureID = SelectedStructure.ID). And I haven't added the commands where I collect the unsaved items to this collection, so it is pretty much a straight load from SharePoint.  The problem is that the form I'm using to create records in SharePoint gives the error "Invalid Formula. Expected a value compatible with 'DataSource'".  

I know that I can give up on using the simpler SubmitForm Command and use the patch instead, but is there something I'm missing?  Is anyone else experiencing this?  I'm on the GCC if that's relevant.

 

I've included images of all the references to this particular collection, but I have experienced it on other collections as well.

 

ErinCannon_0-1597339463093.png

ErinCannon_1-1597339603159.png

ErinCannon_2-1597339697769.png

ErinCannon_3-1597339805671.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ErinCannon
Helper I
Helper I

It turned out that I had accidentally loaded the wrong list into my collection in one of my table refreshes.  Once I referenced the right list, everything worked properly again.  

View solution in original post

3 REPLIES 3
Drrickryp
Super User II
Super User II

Hi @ErinCannon 

The one thing I don't see on your screenshots is the Item property of the form.  A form must have a real datasource such as a sql table, cds entity, excel table or SharePoint list.  The Item property must match the datasource and indicate a record.  If you are using a collection for the gallery, then the Item property must be specific and indicate a record in the datasource. Gallery1.Selected won't do.  Similarly, if the table in the gallery has been reshaped using AddColumns(), etc, then that datasource will not match the one used in the form and a more specific way of identifying the record must be used as in the example below.

 

Lookup(datasource, ID = Gallery1.Selected.ID)

 

where ID (or another field  containing unique values) selects the proper record to be modified.  In the event of a new record, the Item property is ignored since the record hasn't been created. 

The third image shows the item for my form.  First('InventoryItems')  I get what you're saying, but I have had success (a couple of times in this app, even) using an item in a collection as the default item in a form.  The collection has to match the list exactly, but it will work.  I've attached a better image of the data properties of this form and two pictures of forms using collections as the item but SharePoint as data sources where it worked.

 

ErinCannon_2-1597408300798.png

 

 

ErinCannon_0-1597408104239.png

 

ErinCannon_1-1597408144321.png

Thank you for your response.  I'd really like to better understand what's going on here.  Maybe I just got lucky setting up the other ones?

ErinCannon
Helper I
Helper I

It turned out that I had accidentally loaded the wrong list into my collection in one of my table refreshes.  Once I referenced the right list, everything worked properly again.  

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,511)