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

Patch an Incremental ID to existing data in the Excel data source

I have an Excel file used as data source in powerapps and there are two columns within the excel.

First column - "Id" 

Second column called - "addresses"

 

For the Id column, I want to be able to patch an incremental ID to all five rows (There can be any number of addresse so 5 rows is just an example - so the patch function needs to be dynamic) in the Id column so that each row can be uniquely identified by the ID..

 

 

2 REPLIES 2
Dual Super User
Dual Super User

Re: Patch an Incremental ID to existing data in the Excel data source

Hi @IAmTheAppUser 

 

Can you try out the expression as:
 
Patch(ExcelTable,Defaults(ExcelTable),{Id:Value(Last(ExcelTable).Id) +1 , addresses: "Address1"}); Refresh(ExcelTable)
 
Here, ExcelTabel is the name of my excel table. and once the data is patched, make sure that you are refreshing the datasource, so that it points to the latest set of records and this will avoid duplication of the Id.

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

IAmTheAppUser
Level: Powered On

Re: Patch an Incremental ID to existing data in the Excel data source

Thanks for the help.

 

I think the formula that you provides allows me to only add 1 ID under my 'Id' column. 

 

(Before starting the app) The ‘ID' column from my excel data source is empty, therefore, I want the app to (After the app starts) add a ID to each exisiting row without checking the values under the 'address' column (becauses If I need to check the values in the addresses, I won't be able to patch incremental ID to all of the rows in the excel data source right?). 

 

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (4,674)