Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Patch "collection" message after switching to SQL Azure View

First, thank you so much for the ability to use SQL Azure views! Being able to search ALL my records and not just the first 500 is a game-changer.


I changed the data source of my primary gallery from a SQL Azure table to a view, and now my "favorites" checkboxes feature is not working. The Patch function now says "The first argument of 'Patch' should be a collection". Here is the checkbox code:


Patch('[dbo].[EventsView]',First(Filter('[dbo].[EventsView]', EventFavorite=ThisItem.EventFavorite)),{EventFavorite: If(ThisItem.EventFavorite=true,false,true)})

Does this have something to do with not being able to edit views? Here is the code in context:








Hi @RobRoy


I'm not entirely sure why this isn't working. Can you confirm that the screen recognises that it is in edit mode by adding a label and setting the text property to the following?

EditForm1.Mode = FormMode.Edit

If for some reason the conditional statement isn't working, you could possibly receive this error when you call SubmitForm(EditForm1), and EditForm1 is bound to the view.

Ok, I did that. When I start at the beginning and hit the plus icon for a new record, the text box says "false". When I start at the beginning again and select  a gallery item, then click the Edit pencil, it says "true".

Helpful resources

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,948)