cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Readd observation at same row

Dear Member,

 Is there any options to add more one time to only one row?

 

Best regards

Chi

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous ,

For your first question, if you want to add a record but not complete all things into your data source, I think the Patch function could achieve your needs.

Please set the OnSelect property of the "Submit" button to following:

Patch(
         'YourExcelTable',
          Defaults('YourExcelTable'),
         {
           Column1: TextInput1.Text,
           Column2: TextInput2.Text,
... } )

Within the { } part of the Patch function, you could specify the columns you want to populate values for.

 

For your second question, if you want to update the existing record that I have added before, I think the Patch function could also achieve your needs.

Firstly, you need to find the existing record you want to update in your Excel table. You could find the record in your Excel table based on a PRIMARY Column (which identify one record uniquely) using LookUp function:

LookUp('YourExcelTable', PrimaryColumn = "A specific value")

Then set the OnSelect property of the "Update" button to following:

Patch(
       'YourExcelTable',
       LookUp('YourExcelTable', PrimaryColumn = "A specific value"),
{
ModifedColumn1: "xxxx",
ModifiedColumn2: "xxx",
...
} )

More details about the Patch function, please check the following article:

Patch 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

5 REPLIES 5
Community Support
Community Support

Hi @Anonymous ,

Could you please share a bit more about your scenario?

Do you want to add record into your data source more times, but only store them in single one row?

 

If you want to add record into your data source more times, but only store them in single one row, I have made a test on my side, please take a try with the following workaround:

When you add new record into your data source first time, add the new record into your data source. Then when you add new record into your data source next time, modify the existing record with the new entry data.

Set the OnSelect property of the "Submit" button to following:

If(
    IsBlank(First('YourDataSource')),                /*<-- Check if your data source has already one record stored */
    Patch(                                           /* <-- Add Record. If there is no record in your data source, add the new record */
              'YourDataSource',
               Defaults('YourDataSource'),
               {
                   Column1: TextInput1.Text,
                   Column2: TextInput2.Text,
                   Column3: TextInput3.Text,
                    ...
               }
    ),
    Patch(                                          /* <-- Edit existing reocrd. If there is already a record in your data source, update the existing record with your new data */
              'YourDataSource',
               First('YourDataSource'),
               {
                 Column1: TextInput1.Text,
                 Column2: TextInput2.Text,
                 Column3: TextInput3.Text,
                 ...
               }
    )
)

Note: The Column1, Column2, Column3 ... represents the columns in your data source.

Then you could add a Data Table control within your app, set the Items property to your data source. Then you would see the added data would be displayed only one row.

 

More details about the Patch function, please check the following article:

Patch 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.
Anonymous
Not applicable

Dear member, 

 Please see the following picture:Captura.PNG

Best regards

Chi

H @Anonymous ,

Could you please share a bit more about your scenario?

Do you want to add new columns within your Excel table using PowerApps?

 

If you want to add new columns within your Excel table using PowerApps, I afraid that there is no way to achieve your needs in PowerApps currently.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ide as Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

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.
Anonymous
Not applicable

Dear Member, 

 1st: I want to add a record but not complete all things.

 2nd: I want to full the record that I have added before.

 Is it posible to do that?

 

Best regards

Chi

Hi @Anonymous ,

For your first question, if you want to add a record but not complete all things into your data source, I think the Patch function could achieve your needs.

Please set the OnSelect property of the "Submit" button to following:

Patch(
         'YourExcelTable',
          Defaults('YourExcelTable'),
         {
           Column1: TextInput1.Text,
           Column2: TextInput2.Text,
... } )

Within the { } part of the Patch function, you could specify the columns you want to populate values for.

 

For your second question, if you want to update the existing record that I have added before, I think the Patch function could also achieve your needs.

Firstly, you need to find the existing record you want to update in your Excel table. You could find the record in your Excel table based on a PRIMARY Column (which identify one record uniquely) using LookUp function:

LookUp('YourExcelTable', PrimaryColumn = "A specific value")

Then set the OnSelect property of the "Update" button to following:

Patch(
       'YourExcelTable',
       LookUp('YourExcelTable', PrimaryColumn = "A specific value"),
{
ModifedColumn1: "xxxx",
ModifiedColumn2: "xxx",
...
} )

More details about the Patch function, please check the following article:

Patch 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

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (76,823)