cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AB21
Post Partisan
Post Partisan

Generate ID for new item created in a sharepoint list

Hi All, 

 

I was wondering if anyone can help, I have 3 flows running. One which is for creating the items from a form that goes into the Sharepoint list:

Screenshot 2021-03-29 at 7.07.45 PM.png

 

 

another which creates a ID number for a item in a Sharepoint list:Screenshot 2021-03-29 at 6.31.54 PM.png

Expression used to generate the ID:

add(triggerBody()?['ID'],1000)
 
One which sends out an email to the person who submitted the form:

 

Screenshot 2021-03-29 at 6.33.06 PM.png

 

My issue at the minute is the ID generated happens after the item is created so the person which submits the form receives 2 emails one containing the ID that has been generated and another which doesn't. Is it possible to get the email to only happen once and only when the generated ID has been places in the item on the list? 

 

Is there a way of generating the ID in the same flow as the one that creates the item in the first place? 

 

please help!

1 ACCEPTED SOLUTION

Accepted Solutions
RobElliott
Super User
Super User

After you create an item in the list add a delay action of 10 seconds so the create item has a chance to finish, then add a Get item action to get the item you've just created. You can then use the Id in a list. We do this every day to confirm back to the Forms submitter the ID of the support ticket they've just created.

 

getID.png

 

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

The ID is generated by the system when the item is created and that cannot be changed.  But the ID is one of the output values from the create action.  So once an item is created you will have access to the ID.  I would wait to generate you custom ID until after the creation event and use the generated ID.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
RobElliott
Super User
Super User

After you create an item in the list add a delay action of 10 seconds so the create item has a chance to finish, then add a Get item action to get the item you've just created. You can then use the Id in a list. We do this every day to confirm back to the Forms submitter the ID of the support ticket they've just created.

 

getID.png

 

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

Hi @RobElliott  

 

Thanks for this so would you still have a separate flow containing: 

 

Screenshot 2021-03-29 at 6.31.54 PM.png

 

If not how would it look in one flow? 

 

Thanks in advance

It can all be done in the same flow.

 

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,177)