Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

How to update sharepoint item without loop

Like (1) ShareShare
ReportReport
Posted on 4 Oct 2024 19:29:37 by 60
I have a flow that ends with a condition where I want to update an item if the condition is satisfied or create an item if not. Everything works except the update item.
 
When I test the flow, if there aren't any items in the list, it creates them just fine.
 
Then I test the flow a second time, with these items in the list. The result of the second test is that all the items that are in the list update with the current item (without the title, for some reason.)
 
I'm thinking the problem is that Update Item has to be in a loop if I choose the Sharepoint list Item ID, therefore it loops all the items in the list instead of using the current id from the list. What am I doing wrong?
 
If you need more information to analyse the flow, please ask. Thanks.
 
Here are screenshots of my flow.
 
 
  • FLMike Profile Picture
    FLMike 29,371 on 05 Oct 2024 at 19:11:58
    How to update sharepoint item without loop
    Hi
     
    So many details missing. You do not explain why you are getting data from Excel, or if the Excel data has the SharePoint Id etc.
     
    If you want to use Get Item you have to know the ID of the item in SharePoint.
     
    As for the loops etc and why the Title is there, its because you are not grabbing the value at the right now.
     
    The thing is, if you use the Get Items, yes it returns an array of items, but if your filter only retries 1 it only loops (in your apply to each), 1 time.
     
    Please provide mot details in each step that you are doing, and where stuff comes from. You are going to get a Loop when you place the ID because you used the Get Items and without the error I cannot explain what is wrong.
     
    There is no reason why it would loop more than 1 time, as long as your Filter in the Get Items has clear details that make it unique, then you wont care about looping or not.
     
    However to access things without looping you would do
     
    outputs('My Get Files Action')?['body/value']?[0]?['My Data Field']
    where 0 is the Index of the data you want from the Array. If you had only one item then it would just be [0]
     
     
     
  • JDucharme Profile Picture
    JDucharme 60 on 04 Oct 2024 at 20:46:05
    How to update sharepoint item without loop
    I need the Get items for the compare action to work.
     
    Where would I put the Get item? It also gives me a loop when I choose the dynamic list ID, I guess as it should. But I need the current item ID for it to update the current item.
     
    This is the way I configured the condition:
    The SharePointArray gives a combination of Table name and Fiscal year from the sharepint list (tablename-fiscalyear) and the outputs come from the "Nom du tableau" and "Année Fiscale du Tableau" compose actions.
     
    So the only the Condition only points to the array for the SharePoint list. Would that be a problem?
  • David_MA Profile Picture
    David_MA 7,900 on 04 Oct 2024 at 19:38:07
    How to update sharepoint item without loop
    The fourth action in your flow is Get items. If you only want to update 1 item, you need to use the Get item (singular) action. Then the update item action will not end up in a for each action. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,316

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,290

Leaderboard
Loading started
Loading complete