cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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
Community Support

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
Community Support

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

Highlighted
Anonymous
Not applicable

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

 

Thank you,

 

@Anonymous 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (3,112)