cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Younasse
New Member

Completion Percentage of Blank Fields

Hello,

 

I'm hoping you can help or at least point me in the right direction. We have a form that our techs fill out, and we want to add a new completion percent field that calculates the percentage of filled out fields.  

 

Not sure the best way to go about this and I couldn't find any good solutions?

 

Thanks ahead of time

1 ACCEPTED SOLUTION

Accepted Solutions
KyleJ
Helper II
Helper II

I feel like there could be multiple solutions, but here is mine.

First, I would have a Default Variable get set, probably on visible of the screen (assuming your form refreshes on visible as well) 

 

UpdateContext({RemainingFormQuestions:100});

 

I chose 100 as an example but you'll replace this with the # of questions in your form.

But now for the part that tracks the actual remaining amount,
inside of each control, for the OnChange Property, you will have a function very similar to this. It will vary slightly based on the input you are using at the given time. But for a Text Input as an example, It will be something like below: 

 

If(Len(TextInput1.Text)>0,
 UpdateContext({RemainingFormQuestions:RemainingFormQuestions-1}),
 UpDateContext({RemainingFormQuestions:RemainingFormQuestions+1})
)

 

 Every time a user changes a selection/value for an input, that function will run. If the length of the value is greater than 0, that means a selection has been made for that form Control. And it will tick down the counter. Lets say the user goes back to the same control, and removes their answer, leaving it blank again. That would fire the function off, the len( would be = 0, thus adding that item back to the counter. 

That is all of the back end wiring for making your request work. Lastly, Just add a label that will display teh results to the user. something like: 

"%" & RemainingFormQuestions/100 & " of the questions remain."

 

If this has helped you find your way to a solution, please mark as a solution. This helps anyone who has a similar problem find their answer quickly 🙂 

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@Younasse 

Can you please describe your scenario a little bit more?  

You mention a "form", is this actually a Form in your app, or is this information in a Gallery?  

Need to get more information to propose a solution.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Its a form with a lot of fields that techs have to fill out, we would like to calculate what percentage is actually filled out somehow.  Does that help make things clearer?

 

thanks

KyleJ
Helper II
Helper II

I feel like there could be multiple solutions, but here is mine.

First, I would have a Default Variable get set, probably on visible of the screen (assuming your form refreshes on visible as well) 

 

UpdateContext({RemainingFormQuestions:100});

 

I chose 100 as an example but you'll replace this with the # of questions in your form.

But now for the part that tracks the actual remaining amount,
inside of each control, for the OnChange Property, you will have a function very similar to this. It will vary slightly based on the input you are using at the given time. But for a Text Input as an example, It will be something like below: 

 

If(Len(TextInput1.Text)>0,
 UpdateContext({RemainingFormQuestions:RemainingFormQuestions-1}),
 UpDateContext({RemainingFormQuestions:RemainingFormQuestions+1})
)

 

 Every time a user changes a selection/value for an input, that function will run. If the length of the value is greater than 0, that means a selection has been made for that form Control. And it will tick down the counter. Lets say the user goes back to the same control, and removes their answer, leaving it blank again. That would fire the function off, the len( would be = 0, thus adding that item back to the counter. 

That is all of the back end wiring for making your request work. Lastly, Just add a label that will display teh results to the user. something like: 

"%" & RemainingFormQuestions/100 & " of the questions remain."

 

If this has helped you find your way to a solution, please mark as a solution. This helps anyone who has a similar problem find their answer quickly 🙂 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,917)