I'm trying to patch a data source based on values in a collection and cannot figure out how to do it.
Here's my situation. I have a web site that has 10 pages on it. Each page has a message box where I want to post messages to. The web site is database driven and I have a table for the page information.
The table (dbo.Pages) has ID (primary key), Title, and AlertHtml columns.
My PowerApp has dbo.Pages as a data source.
I have a text box for a message, a list box for pages, and I have a gallery for styles (which gets prepended to the text box value)
I want to be able to post the message to any pages I select in the list box.
My initial thought was to put the Pages selected from the list box into a collection (colChosenPages) then loop through them and patch to dbo.Pages. But there is NO LOOP function! I looked at ForAll and Patch combinations but I don't understand how I use the matching criteria in Patch.
Here's what I was trying that does not work.
ForAll(colChosenPages,Patch('[dbo].[Pages]',Id=colChosenPages.Id,{AlertHtml:varMessageText})))
How can I add the message to the pages table for each of the pages chosen in the list box?
Thank you