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

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
Highlighted
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!

Highlighted
Frequent Visitor

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (6,000)