I am pretty new to Powerapps and have created an app to mess around with while I learn how to do some of the things that will be needed when I build the app I need.
I am running into an issue trying to update both the original data source (stored in One Drive) and a collection.
The Basics:
Collection Name: Testcoll
Data source name: Testtable
Table name in data source: Testtbl (I know, very creative)
Data card name: Store #
Text Input Box: Storetst
I would like to have a button that saves the info entered in the text input box (Storetst) to both an existing collection (Testcoll) as well as the original data source. I have tried a few syntax variations but I can only get the Collection to update not the data source.
If someone could please give me some guidance it would be greatly appreciated. Also, if possible, can you walk me through the syntax you would use so I can understand how it works. I would like to learn where I am making mistakes and how the correct syntax works.
Please and Thanks in advance!
Thanks for posting in the community @Jhogan21 - can you review the above reply and update the thread if it was helpful?
Thank you,
@Anonymous
Hi @Jhogan21 ,
Do you want to add a new record into your existing Collection and the original Excel table data source?
Could you please share a bit more about the formula you used within your app?
Based on the needs that you mentioned, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Set the OnSelect property of the "Submit" button to following formula:
Patch( /* <-- Add new reocrd into your Collection -- Testcoll */ Testcoll, Defaults(Testcoll), { 'Store #': Storetst.Text } ); Patch( /* <-- Add new reocrd into your Excel table -- Testtbl */ Testtbl, Defaults(Testtbl), { 'Store #': Storetst.Text } )
Or
Concurrent( /* <-- Execute the following two Patch formula at the same time */ Patch( /* <-- Add new reocrd into your Collection -- Testcoll */
Testcoll,
Defaults(Testcoll),
{ 'Store #': Storetst.Text }
),
Patch( /* <-- Add new reocrd into your Excel table -- Testtbl */
Testtbl,
Defaults(Testtbl),
{ 'Store #': Storetst.Text }
) )
More details about Patch function and Concurrent function, please check the following article:
Best regards,