Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Update data source and collection

(0) ShareShare
ReportReport
Posted on by 15

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!

Categories:
  • 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,

     

    @Anonymous 

  • Verified answer
    v-xida-msft Profile Picture
    v-xida-msft on at
    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,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard