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

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

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,603)