cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jhogan21
Level: Powered On

Update data source and collection

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Update data source and collection

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:

Patch function

Concurrent function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Update data source and collection

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:

Patch function

Concurrent function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Administrator
Administrator

Re: Update data source and collection

Thanks for posting in the community @Jhogan21 - can you review the above reply and update the thread if it was helpful? 

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 282 members 1,940 guests
Please welcome our newest community members: