Hi!
I'm creating a record in PowerApps and saving it to Sharepiont List with Patch() function:
Patch(PhoneVacation, Defaults(PhoneVacation),
{Vacation_x0020_Type:Dropdown_Vacation.Selected.Value,Detail: Detail.Text,...
Now I want to get ID of the new item that is created in Sharepoint list and pass it to worflow.
Does anyone knows how do I get the last item ID from sharepoint list back to PowerApps?
Thanks a lot
Solved! Go to Solution.
Then you can try
Refresh(PhoneVacation); Set(LastAddedItem,First(Sort(PhoneVacation,ID,SortOrder.Descending)))
Théo
Hi @petergriac
If you can consider using a SubmitForm function instead of a Patch, you can use the LastSubmit property of a form.
SubmitForm(EditForm1)
EditForm1.LastSubmit.ID will return the ID of item you've just created.
Théo
Thanks Theo.
Do you know if there is another way? I'm not using forms here.
Then you can try
Refresh(PhoneVacation); Set(LastAddedItem,First(Sort(PhoneVacation,ID,SortOrder.Descending)))
Théo
Thanks a lot, this works for me
@tchin-nin, how would I alter this code to get it to write to a column in a different sharepoint list?
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
204 | |
106 | |
56 | |
52 | |
41 |
User | Count |
---|---|
274 | |
156 | |
86 | |
81 | |
56 |