I have a flow that collects Form responses and populates a Sharepoint list. My problem is that it creates blank items for questions that have not been answered in the Form:
Is there a way to have the flow only create items for questions that have received a response?
It seems you want to avoid the creation of a SharePoint item in case the reply to a question is empty.
It seems you may be missing a condition to check if the “output” from “compose 3” is null or not.
Since it is in an apply to each, it will review every answer and in case it is not empty, it will create an item at SharePoint level.
The condition above will work and the question that is not answered will not be created as an item in the SharePoint List but you may need to change your logic because with the current one you will be creating a lot of items in the SharePoint list considering the number of questions you have in the form.
Imagine you have a form with 3 questions, in case 10 persons reply, it will create 30 items in SharePoint.
You may need to customize your SharePoint list so that each reply to be a customer’s reply column.
Thanks for responding.
When I try to use the function string("") in a condition, I get an error that says it's an invalid expression.
Also, when I try to add a "Create Item" operation under the "No" side of the Condition, I get an error that says "Cannot read property 'getid' of undefined."
The function you should use in the condition is string('') and not string("") otherwise you will be seeing the invalid expression error message.
The logic i have is in case the output is equal to empty, it will not do anything but in case it is not, it will create the item in the sharepoint list.
Regarding the error message, please check if after applying the logic from the condition you have the same error. In case you have, please debug the scenario on the failed execution and see what could be the variable or action that may not be defined.
I fixed the function to be used in the condition, and the flow now doesn't create any error messages. However, it still creates a Sharepoint item for all of the form responses, even the empty ones:
Here's the condition that I added:
Please check in the flow run the "Outputs" values to see why the condition is not being met for the iteration that should be empty.
Tiago Ribeiro | Power Platform Support Engineer.
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!