cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Create or update a sharepoint item in flow

Hello.

 

I'm trying to build a work hour tracking system as a SharePoint list that uses Flow and potentially PowerApps to add or update rows.  

 

I'd like our users to click on clock in, clock out, start lunch or end lunch that would update their row for the day.  

 

To achieve this I'm using a Condition based on a search for SharePoint items with the title 'Username - date'.  If there are no rows found it goes to the Yes condition- where it can create a row- and if any rows are found it can update the rows it finds.  

This looks like this:
image.png

 

 

 

 

 

 

 

 

 

As soon as I try to add Dynamic Content as a title of the new list item flow wraps the thing in a foreach loop like this:image.png

 

 

 

 

 

 

As no rows are returned in the initial Get Items query then there's nothing to iterate so I can't create create an item at all.

 

Does anyone know how I can stop this happening or another way to create or update an item?  

 

Many thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

In create item you are trying to use the Date dynamic content value from get items which will result in a for loop

Also , since no items are returned, the for loop will not run and items wont be created

 

replace that Date dynamic content with utcNow() and format it based on your needs

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

In create item you are trying to use the Date dynamic content value from get items which will result in a for loop

Also , since no items are returned, the for loop will not run and items wont be created

 

replace that Date dynamic content with utcNow() and format it based on your needs

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

Many thanks.  Much appreciated!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,371)