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
Super User
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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 167 members 4,610 guests
Please welcome our newest community members: