web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Apply to each did not run
Power Automate
Unanswered

Apply to each did not run

(0) ShareShare
ReportReport
Posted on by 27

Hi,  I'm trying to create a flow where by a new event in Outlook will create an event as well in SharePoint Calendar.  I was able to do to the flow with simple create item, successful when an event created in Outlook it will create as well in SharePoint calendar.  However,  I need to put a limit on SP-Calendar a maximum of 5 entries only.  I added a column called "Booking Limit"  on my flow I added the "Get items" and a condition which created an "apply to each" but it wont continue inside, it stops there and the flow succeeded with no errors. Also, not sure if the syntax for the booking limit to increment is correct might be the cause why the apply to each is stopping.  This is what I put on the expression: 

"add(if(equals(items('Apply_to_each')?['Booking_x0020_Limit'],null),0,items('Apply_to_each')?['Booking_x0020_Limit']),1)"

 

Need your help and guidance on this one.  thanks!

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @ronald_caro Your Get items must be returning 0 items. Check your filter criteria and list items.

     

     

  • ronald_caro Profile Picture
    27 on at

    Hi Sudeep, thanks for that information.  So, what I did, I added a condition using "length()" is not equal to "0" I was able to add record for the 1st time.  However, if there is another event created, this time the apply to each is working but it doubles up the record and I could not get the proper result for adding 1 in the booking limit.  The expression I used in Booking Limit column - "add(if(equals(items('Apply_to_each')?['Booking_x0020_Limit'], null), 0, items('Apply_to_each')?['Booking_x0020_Limit']), 1)" 

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Are show me the output of your Get items actions in JSON?

    and also, please show the screenshot of your apply to each action in design mode.

     

  • ronald_caro Profile Picture
    27 on at

    Hi Sundeep,  below is the Json output from "Get Items" and attached is the screenshots for "Apply for each"

     

    {
    "statusCode": 200,
    "headers": {
    "Cache-Control": "max-age=0, private",
    "Transfer-Encoding": "chunked",
    "Vary": "Origin,Accept-Encoding",
    "X-NetworkStatistics": "0,525568,0,0,104,0,23727",
    "X-SharePointHealthScore": "2",
    "X-MS-SPConnector": "1",
    "X-SP-SERVERSTATE": "ReadOnly=0",
    "DATASERVICEVERSION": "3.0",
    "SPClientServiceRequestDuration": "181",
    "SPRequestDuration": "181",
    "X-DataBoundary": "NONE",
    "SPRequestGuid": "5a49efd4-eab3-4c2b-a3fa-490cf4336b54",
    "request-id": "5a49efd4-eab3-4c2b-a3fa-490cf4336b54",
    "MS-CV": "1O9JWrPqK0yj+kkM9DNrVA.0",
    "Strict-Transport-Security": "max-age=31536000",
    "X-Frame-Options": "SAMEORIGIN",
    "Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.office365.com *.powerapps.com *.yammer.com engage.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com securebroker.sharepointonline.com;",
    "MicrosoftSharePointTeamServices": "16.0.0.24607",
    "X-Content-Type-Options": "nosniff",
    "X-MS-InvokeApp": "1; RequireReadOnly",
    "P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
    "X-AspNet-Version": "4.0.30319",
    "X-Powered-By": "ASP.NET",
    "Timing-Allow-Origin": "*",
    "x-ms-apihub-cached-response": "false",
    "x-ms-apihub-obo": "false",
    "Date": "Tue, 27 Feb 2024 01:48:40 GMT",
    "Content-Type": "application/json; charset=utf-8",
    "Expires": "Mon, 12 Feb 2024 01:48:40 GMT",
    "Last-Modified": "Tue, 27 Feb 2024 01:48:40 GMT"
    },
    "body": {
    "value": [
    {
    "@odata.etag": "\"1\"",
    "ItemInternalId": "26",
    "ID": 26,
    "Title": "Ronald Caro ",
    "EventDate": "2024-02-28T21:00:00Z",
    "EndDate": "2024-02-28T21:30:00Z",
    "Meeting_x0020_Room_x0020_Service": [],
    "Meeting_x0020_Room_x0020_Service@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)",
    "Meeting_x0020_Room_x0020_Service#Id": [],
    "Meeting_x0020_Room_x0020_Service#Id@odata.type": "#Collection(Int64)",
    "Booking_x0020_Limit": 1,
    "Location": "Workspace-AUBNE",
    "Description": "<html><head>\r\n\r\n\r\n<style>\r\n.EmailQuote {\nmargin-left:1pt;\npadding-left:4pt;\nborder-left:#800000 2px solid;\n}\n\r\n</style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size&#58;11pt;\"><div class=\"PlainText\">&#160;</div></span></font>\r\n</body>\r\n</html>\r\n",
    "ParticipantsPicker": [],
    "ParticipantsPicker@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser)",
    "ParticipantsPicker#Claims": [],
    "ParticipantsPicker#Claims@odata.type": "#Collection(String)",
    "Modified": "2024-02-27T00:50:36Z",
    "Created": "2024-02-27T00:50:36Z",
    "Author": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Author#Claims": "i:0#.f|membership|automation@contoso.com",
    "Editor": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Editor#Claims": "i:0#.f|membership|automation@contoso.com",
    "{Identifier}": "Lists%252fWorkspace%2bBookings%252f26_.000",
    "{IsFolder}": false,
    "{Thumbnail}": {
    "Large": null,
    "Medium": null,
    "Small": null
    },
    "{Name}": "Ronald Caro ",
    "{FilenameWithExtension}": "Ronald Caro ",
    "{Path}": "Lists/Workspace Bookings/",
    "{FullPath}": "Lists/Workspace Bookings/26_.000",
    "{ContentType}": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
    "Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "Name": "Event"
    },
    "{ContentType}#Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "{HasAttachments}": false,
    "{VersionNumber}": "1.0"
    },
    {
    "@odata.etag": "\"1\"",
    "ItemInternalId": "27",
    "ID": 27,
    "Title": "Ronald Caro ",
    "EventDate": "2024-02-28T22:00:00Z",
    "EndDate": "2024-02-28T22:30:00Z",
    "Meeting_x0020_Room_x0020_Service": [],
    "Meeting_x0020_Room_x0020_Service@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)",
    "Meeting_x0020_Room_x0020_Service#Id": [],
    "Meeting_x0020_Room_x0020_Service#Id@odata.type": "#Collection(Int64)",
    "Booking_x0020_Limit": 1,
    "Location": "Workspace-AUBNE",
    "Description": "<html><head>\r\n\r\n\r\n<style>\r\n.EmailQuote {\nmargin-left:1pt;\npadding-left:4pt;\nborder-left:#800000 2px solid;\n}\n\r\n</style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size&#58;11pt;\"><div class=\"PlainText\">&#160;</div></span></font>\r\n</body>\r\n</html>\r\n",
    "ParticipantsPicker": [],
    "ParticipantsPicker@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser)",
    "ParticipantsPicker#Claims": [],
    "ParticipantsPicker#Claims@odata.type": "#Collection(String)",
    "Modified": "2024-02-27T00:55:46Z",
    "Created": "2024-02-27T00:55:46Z",
    "Author": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Author#Claims": "i:0#.f|membership|automation@contoso.com",
    "Editor": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Editor#Claims": "i:0#.f|membership|automation@contoso.com",
    "{Identifier}": "Lists%252fWorkspace%2bBookings%252f27_.000",
    "{IsFolder}": false,
    "{Thumbnail}": {
    "Large": null,
    "Medium": null,
    "Small": null
    },
    "{Name}": "Ronald Caro ",
    "{FilenameWithExtension}": "Ronald Caro ",
    "{Path}": "Lists/Workspace Bookings/",
    "{FullPath}": "Lists/Workspace Bookings/27_.000",
    "{ContentType}": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
    "Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "Name": "Event"
    },
    "{ContentType}#Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "{HasAttachments}": false,
    "{VersionNumber}": "1.0"
    },
    {
    "@odata.etag": "\"1\"",
    "ItemInternalId": "28",
    "ID": 28,
    "Title": "Ronald Caro ",
    "EventDate": "2024-02-28T23:00:00Z",
    "EndDate": "2024-02-28T23:30:00Z",
    "Meeting_x0020_Room_x0020_Service": [],
    "Meeting_x0020_Room_x0020_Service@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)",
    "Meeting_x0020_Room_x0020_Service#Id": [],
    "Meeting_x0020_Room_x0020_Service#Id@odata.type": "#Collection(Int64)",
    "Booking_x0020_Limit": 1,
    "Location": "Workspace-AUBNE",
    "Description": "<html><head>\r\n\r\n\r\n<style>\r\n.EmailQuote {\nmargin-left:1pt;\npadding-left:4pt;\nborder-left:#800000 2px solid;\n}\n\r\n</style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size&#58;11pt;\"><div class=\"PlainText\">&#160;</div></span></font>\r\n</body>\r\n</html>\r\n",
    "ParticipantsPicker": [],
    "ParticipantsPicker@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser)",
    "ParticipantsPicker#Claims": [],
    "ParticipantsPicker#Claims@odata.type": "#Collection(String)",
    "Modified": "2024-02-27T01:01:02Z",
    "Created": "2024-02-27T01:01:02Z",
    "Author": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Author#Claims": "i:0#.f|membership|automation@contoso.com",
    "Editor": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Editor#Claims": "i:0#.f|membership|automation@contoso.com",
    "{Identifier}": "Lists%252fWorkspace%2bBookings%252f28_.000",
    "{IsFolder}": false,
    "{Thumbnail}": {
    "Large": null,
    "Medium": null,
    "Small": null
    },
    "{Name}": "Ronald Caro ",
    "{FilenameWithExtension}": "Ronald Caro ",
    "{Path}": "Lists/Workspace Bookings/",
    "{FullPath}": "Lists/Workspace Bookings/28_.000",
    "{ContentType}": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
    "Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "Name": "Event"
    },
    "{ContentType}#Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "{HasAttachments}": false,
    "{VersionNumber}": "1.0"
    },
    {
    "@odata.etag": "\"1\"",
    "ItemInternalId": "29",
    "ID": 29,
    "Title": "Ronald Caro ",
    "EventDate": "2024-02-28T23:00:00Z",
    "EndDate": "2024-02-28T23:30:00Z",
    "Meeting_x0020_Room_x0020_Service": [],
    "Meeting_x0020_Room_x0020_Service@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)",
    "Meeting_x0020_Room_x0020_Service#Id": [],
    "Meeting_x0020_Room_x0020_Service#Id@odata.type": "#Collection(Int64)",
    "Booking_x0020_Limit": 1,
    "Location": "Workspace-AUBNE",
    "Description": "<html><head>\r\n\r\n\r\n<style>\r\n.EmailQuote {\nmargin-left:1pt;\npadding-left:4pt;\nborder-left:#800000 2px solid;\n}\n\r\n</style></head>\r\n<body>\r\n<font size=\"2\"><span style=\"font-size&#58;11pt;\"><div class=\"PlainText\">&#160;</div></span></font>\r\n</body>\r\n</html>\r\n",
    "ParticipantsPicker": [],
    "ParticipantsPicker@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser)",
    "ParticipantsPicker#Claims": [],
    "ParticipantsPicker#Claims@odata.type": "#Collection(String)",
    "Modified": "2024-02-27T01:01:05Z",
    "Created": "2024-02-27T01:01:05Z",
    "Author": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Author#Claims": "i:0#.f|membership|automation@contoso.com",
    "Editor": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|automation@contoso.com",
    "DisplayName": "Automation",
    "Email": "automation@contoso.com",
    "Department": "IT Support",
    "JobTitle": "Workflow Automation"
    },
    "Editor#Claims": "i:0#.f|membership|automation@contoso.com",
    "{Identifier}": "Lists%252fWorkspace%2bBookings%252f29_.000",
    "{IsFolder}": false,
    "{Thumbnail}": {
    "Large": null,
    "Medium": null,
    "Small": null
    },
    "{Name}": "Ronald Caro ",
    "{FilenameWithExtension}": "Ronald Caro ",
    "{Path}": "Lists/Workspace Bookings/",
    "{FullPath}": "Lists/Workspace Bookings/29_.000",
    "{ContentType}": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
    "Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "Name": "Event"
    },
    "{ContentType}#Id": "0x010200543FAED5D714C34A8A306210F72CF329",
    "{HasAttachments}": false,
    "{VersionNumber}": "1.0"
    }
    ]
    }
    }
  • ronald_caro Profile Picture
    27 on at

    Hi Sundeep,  tried to paste the JSON but after hitting the reply it will show for a moment then it will disappear, is there in particular you need to see maybe its too long that could be the reason why its disappearing, I will just past that portion you need.  Anyways, here's the screen shot

  • ronald_caro Profile Picture
    27 on at

    Hi I was able to resolved the adding, and the incremental + 1 to the column booking limit is by adding a variable to my flow.  The only thing that I cannot resolved is when the apply to each reads the data from the get items, it doubles up my record event in SP-Calendar.

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    It is because of the loop

    SudeepGhatakNZ_0-1709023225180.png

     

    You must be referencing a column that stores multi select values, is that correct?

     

  • ronald_caro Profile Picture
    27 on at

    Hi Sudeep not referencing that column but I have deleted that with multi-select values and still the same, Still doubling up the record before adding the plus 1, by the way thanks for all the guidance I was able to identify what is missing on my flow and able to work it,  This one I'm not sure what is the cause of the doubling up.  Is there any setting I need to check or need to do like another step or card to add to avoid or fix the doubling up the records?  Thanks!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard