We created a survey using power apps. The survey contains about 100 fields from a sharepoint list (45 Questions and 45 comments for each question).
Since the list was very long, we divided the questions into each screen and displayed only those questions based on a conditional logic. A user selects checkoxes of which sections he would like to answer and the navigation has been set that way.
I am not using Edit form but created scrollable screens.
This worked fine.
The issue is displaying the details of the survey a user submitted. I am using a browse gallery and a details form to display the questions and comments.
The problem is if I am trying to put all the 100 fields in the details form, it won't work obviously or it would take along time to retrieve the records.
How can I display only those questions which have been answered by the user? Is there any better way to handle thi s situation without crashing the app. Is there a better way of filtering the records?
I am not sure if Visible property would help since I have to keep all the fields on the details form anyway.
Please let me know if you need any additional details from my end.
If you have SharePoint, there is a native survey app that can do all of this for you:
If there is a specific reason why you created a list and want to then put it in an app to enhance the user experience, then I can think of at least 2 ways to do this (and I'm sure others can think of more):
Use PowerApps Forms
I didn't get into the nitty-gritty, but I hope that gives you a direction.
Do you add a column within your SP list to store the user who submitted the survey?
Which data type is the Questions column in your SP list?
Further, do you want to display only those questions which have been answered by the user within the Detail form?
I agree with your thought almost, I think the Visible property of the Data card control within the Detail form could achieve your needs.
I assume that you add a column in your SP list to store the user (e.g. FullName, email, DisplayName, etc.) who submitted the survey, you could look up your SP list data source based on the current user, check if the corresponding question has been answered, if yes, make the corresponding Data card visible, if not, make the corresponding Data card invisible.
I have made a test on my side, please take a try with the following workaround:
Set the Visible property of the Question1 Data card within the Detail form to following:
Note: The UserName represents the column which is used to store the who submitted the survey within your SP list. The Question1 represents the first question field in your SP list.
Set the Visible property of the Question2 Data card within the Detail form to following:
If( !IsBlank( LookUp('YourSPList',UserName=User().Mail,Question2) ), true, false )
Set the Visible property of the Question3 Data card within the Detail form to following:
If( !IsBlank( LookUp('YourSPList',UserName=User().Mail,Question3) ), true, false )
Set the Visible property of the Question45 Data card within the Detail form to following:
If( !IsBlank( LookUp('YourSPList',UserName=User().Mail,Question45) ), true, false )
More details about the LookUp function in PowerApps, please check the following article:
Thank you all for the suggestion. The reason for building a survey app was to enable the users to submit the answers online.
I was having an issue in the detail form to only display the questions that the users chose to answer.
I have achieved the solution by using the Visible property and diplaying only those fields which the user answered.
I have the details of the user name and email address.
For this, sine the dataset was large, I am using a collection to first collect the data from the SharePoint and then using the fields off of the collection. This way, I am not having an issue with the form being displayed without any lag or performance errors.
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
Learn how to build the business apps that you need.