Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Flow error every time the other sections in Forms has no answer

(0) ShareShare
ReportReport
Posted on by 2

I build a flow where every time a response submitted in Microsoft forms it will directly connect to Sharepoint calendar. So, in the form you need to input the dates that you will going to work in the office. I put 5 lines so if they need to work in the office for 5 days, they can just fill-up 1 form. But the thing is if they just fill-up 1 line and they will not fill up the other 4 because they will just report to the office for 1 day and this happens multiple times consecutively. There will be an error and my flow will turn off. I think the problem is on how I build my flow. Can you please help me how to fix it. I will attach the flow I create and the forms.

 

Flow.PNG

 

Form.PNG

 

  • Lablirows Profile Picture
    2 on at
    Re: Flow error every time the other sections in Forms has no answer
    Hi, thank you for this. I'll try it on my flow and will update if everything works. 🙂
  • creativeopinion Profile Picture
    10,389 Super User 2025 Season 1 on at
    Re: Flow error every time the other sections in Forms has no answer

    @Lablirows The parallel Apply to Each actions are unnecessary and inefficient. 

    Manually Trigger Flow (while building)

    While you are building your flow I would recommend you use a Manual trigger. This will help speed up your flow building process and allow you to quickly test at each stage of your flow. Tip: Always rename your actions to keep things organized!

     

    Review a previous flow run and copy the Form Id to your clipboard and take note of the Response Id.

    creativeopinion_3-1700000474990.png

    Insert that into the Get response details action of your flow. 

    creativeopinion_4-1700000519108.png

     

    Create an Array

    Because you have multiple onsite details that you'd like to loop through. It's best to create an Array that can be looped through. For more tips on using the Apply to Each action—refer to this recent YT Tutorial I uploaded.

     

    By creating an array you can use a Filter Array action to pull out the items that only contain values in the location and date fields. For more information on how to use the Filter Array action—refer to this YT Tutorial.

     

    A basic array looks like this.

     

    [
    {
    "item 1"
    },
    {
    "item 2"
    },
    {
    "item 3"
    }
    ]

     

    For your array, treat each onsite option as an item. The key (eg. "onsite", "location",  "date" can be customized to your requirements. You'll just need to note these keys for use later.

     

    The content (eg. Onsite 1, Onsite 2, Onsite 3) is what will be outputted when you reference the key in an expression. This can also be customized to your requirements.

    [
    {
    "onsite": "Onsite 1",
    "location": [insert dynamic content for location],
    "date":[insert dynamic content for date]
    },
    {
    "onsite": "Onsite 2",
    "location": [insert dynamic content for location],
    "date":[insert dynamic content for date]
    },
    {
    "onsite": "Onsite 3",
    "location": [insert dynamic content for location],
    "date":[insert dynamic content for date]
    }
    ]

    creativeopinion_5-1700000839939.png

    Run a test. Any dynamic fields that are empty will display "". In this example below, the Onsite 2 and Onsite 3 

    creativeopinion_6-1700000867229.png

    Filter Array

    Add a Filter Array action to your flow. You'll use this action to filter out items that do not have an empty location and empty date. 

     

    In the From field, insert the Outputs from the Compose action above (the one that has your array). Click on Edit in advance mode.

     

    creativeopinion_7-1700001174847.png

    You'll need to use an expression. Do not try to type into this field. You will need to use a text editor to compose your expression first, then copy/paste it into the field. Refer to this section of my YT Tutorial on how to use multiple conditions in the Filter Array action and why you can't type into that field. 

     

    The expression you will need to use will look something like this. Note: This may be a bit different based on your array keys.

    @and(not(equals(item()?['location'], '')), or(not(equals(item()?['date'], '')), equals(item()?['date'], '')))

    Run a test. As you can see the inputs show 3 items in the array. However after the array has been filtered, only a single item has returned.

    creativeopinion_13-1700001509871.png

    Check the Count of Items Returned

    Whenever I use a Filter Query in a Get Items action, I always like to return the count of items returned in a Compose action. This is helpful when building a flow and can also be used to troubleshoot your flow.

    Insert a Compose action. Add an Expression. Use the length() function.

    creativeopinion_11-1700001469248.png

     

    Select the Dynamic content tab and insert the value dynamic content from the Get Items action into the length() function.

    creativeopinion_12-1700001481458.png

     

    Run a test.

     

    Add a Condition

    Add a Condition action to your flow to check the number of items returned. If no items have returned, do nothing, The rest of your actions can go into the YES branch.

     

    creativeopinion_14-1700001610792.png

     

    Apply to Each Item

    Add an Apply to Each action and insert the Body outputs from the Filter Array action. This Apply to Each action will loop through each item from your array that has been filtered (aka the outputs from the Filter Array action).

    creativeopinion_15-1700005817954.png

     

    Get the Dynamic Content

    For more information on how to access dynamic content from a Filter Array action—refer to this section of my YT Tutorial. The Compose actions are optional—however they can help with troubleshooting and it's easy to confirm the dynamic content before using it in a Create Item action. 

     

    Use the item() function. Insert the following into the Expression field.

    item()?['']

    creativeopinion_16-1700006258746.png

    In between the single quotes enter the dynamic content key. For this example, I'll use onsite.

    creativeopinion_17-1700006313714.png

    creativeopinion_18-1700006337719.png

     

    Repeat these steps for each key.

    creativeopinion_20-1700006473314.png

     

    Run a test. Verify the outputs of each Compose action.

    creativeopinion_19-1700006442972.png

     

    Create Item

    You can now insert the Create Item action and use the outputs from each compose action in the appropriate fields.

    creativeopinion_21-1700006653023.png

     

    Save As + Replace Trigger

    Once you've tested your flow and confirmed everything works, create a copy of your flow and replace the trigger. I would recommend keeping the manually triggered flow for testing purposes. This will be handy should your form change in the future or if you are running to any issues with the automatically triggered flow.

    creativeopinion_22-1700006827626.png

    Replace the response ID with the Response id dynamic content from the flow trigger.

    creativeopinion_23-1700006866998.png

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow