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 / Multiple Files from Di...
Power Automate
Unanswered

Multiple Files from Different MS Forms Questions, Not All Mandatory - Parse JSON code Fails with Blank Response

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I completed the flow below however I am encountering two issues which I cannot seem to get around.

Mila_3-1659613587907.png

 

1. When a document with the same name is uploaded by a user filling in an MS Form in response to different questions, the flow fails. Is there a way to avoid this?

 

2. Following this solution (Solved: Re: Get multiple files from different MS Forms upl... - Power Platform Community (microsoft.com)), I have two conditions set up so that, if one of the 'Please upload' questions do not come up in the form branching, the Flow skips it. In the blank field after 'is not equal to' I tried to use these four individual options:      ""     " "       null      "null"

When I save and exit the flow and get back into it, the value has either disappeared or remains as null, but the flow fails:

 

Mila_1-1659613200185.png

 

Mila_0-1659612951386.png

 

Does anyone have any ideas as to why this might happen?

Perhaps @Jay-Encodian?

 

Many thanks!

Mila

Categories:
I have the same question (0)
  • Verified answer
    ChadVKealey Profile Picture
    1,393 on at

    I've found conditions to be a real pain at times, especially when the condition you're checking is a blank/null value. I prefer to use the "Configure run after" property/setting so that when that action fails, the flow will continue to run. See https://youtu.be/jBTmX0cm6NU for the pattern I use. 

     

    If you prefer to use a condition, then you may have better luck comparing the length of the response (using the "length()" expression) than checking for the presence/absence of the response. In other words, on the left side of the condition, enter the expression "length(<file-upload-question>)" and check if that is equal to (or not equal to) the number zero (0). If the question is left blank, it'll have a length of zero characters.

     

    As for the duplicate file names, you really just need to do something to make sure that file names are unique. It could be appending the date/time of the form submission or file creation (e.g.: utcnow()), the name of the submitter, or something else. Other SharePoint file actions (specifically the "Move file") have a built-in setting to handle name collisions, but not the "Create file" action. So, the choices are either check if the name exists and, if so, append something to make it unique OR just always append some consistent string to ensure that every dynamically-generated file name is unique. I'm a big fan of consistent naming conventions for files, so in nearly every project I work with the client to find a convention that works for them.

  • Community Power Platform Member Profile Picture
    on at

    Thanks very much @ChadVKealey !

     

    My limited knowledge meant that I could not quite fully understand and use the information in your video and directly apply it in my flow as mine aims at saving the attachment in a SharePoint list versus sending an email. 

    I did however use the 'length' expression option and that seems to be working well! Asking users to do some rounds of testing, so fingers crossed. 

     

    Thanks very much, I appreciate you help!

    Mila

     

  • ChadVKealey Profile Picture
    1,393 on at

    In terms of getting the form response data and accounting for no responses to non-required questions, the process is exactly the same regardless of what you intend to do with the files that are submitted. This playlist contains a series of videos that go into more detail, starting with the basics: https://youtube.com/playlist?list=PLMVyjgrWIGnylSE6NAy_OIG4_ZBqzZtp5

     

    However, I don't specifically talk about what to do with those non-required file upload questions there.

  • Community Power Platform Member Profile Picture
    on at

    Thanks @ChadVKealey, and sorry for the late response (annual leave).

     

    The Flow just failed as two people were submitting the form at the same time. 

     

    Error:

    Save Conflict.

    Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes.

    Mila_0-1661425162313.png

    Upon resubmitting it, it worked, and created a new row into the SharePoint list. Do you know whether there is a way for me to avoid this? I read a thread earlier but could not quite work out what to amend. 

     

    Thanks in advance for any help you can provide! 

    Mila

     

  • ChadVKealey Profile Picture
    1,393 on at

    What step within that Apply to each failed?

  • Community Power Platform Member Profile Picture
    on at

    Hi @ChadVKealey 

     

    It is the step that looks for the attachment in the MS Form and then adds it on to the SharePoint list. There are two questions that have a mandatory form upload step, and one of the two failed, whereas the other worked. The files uploaded has different file names. 

     

    Thank you. 

    Mila

     

    Mila_0-1661431359765.png

     

  • ChadVKealey Profile Picture
    1,393 on at

    Due to the parallel branch, you're basically updating the item twice at the same time to attach the two files. It has nothing to do with two submissions being made at the same time, but rather the same flow trying to update the same item simultaneously. 

     

    At a minimum, you should eliminate the parallel branch and just make it a single sequence. Alternatively, you could add all of the files into an array variable and then iterate through that array to attach each file. See https://youtu.be/2mrcTMkwelE for more details on that option.

  • Community Power Platform Member Profile Picture
    on at

    Thanks very much @ChadVKealey! For now I have removed the parallel branching. Testing again tomorrow. I will also look to rebuild with the array variable so I learn how to do that. 

     

    Thanks again, your tutorials are super helpful and I appreciated your help!

    Mila

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard