cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Show multiple variables if value is true

Hello,

 

I've got some checkboxes in one of my Powerapps and in a later screen i would like to summarize and show the ones that are checked. I've created an if statement that i think is correct but i get stuck on how to show the checkboxes if they are checked.

 

Does anyone know how to show the name of the textboxes if they are checked? This is my if statement.

 

If(Or(Role_DM.Value);(Role_IE.Value);(Role_Mgr.Value);(Role_SD.Value);(Role_SD_1st.Value);(Role_SD_2nd.Value);(Role_TL.Value);true;false)

 

Oh! And this is an ifstatement in an HTML-Textbox summarizing info from several screens.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

@mdevaney,

 

Just wanted to show what nailed it for me. The lines below is now showing my collection column values in my html textbox.

"<Table>"&
"<tr>"&
"<th>Department</th>"&
"<th>Role(s)</th>"&
"</tr>"&
"<tr>"&
"<td>"&Department.Selected.GroupName&"</td>"& "<td>"&Concat( EmpRoles, CheckboxText & "<br>" )&"</td>"&
"</tr>"&
"<tr>"&
"<td></td>"&
"</tr>"&
"<Table>

 

Thank you very much for giving me the advice before. Smiley Happy

View solution in original post

5 REPLIES 5
mdevaney
Super User
Super User

@Anonymous 

 

You can use the following code.  Note that I had to type in the Checkbox names manually.

 

If(Role_DM.Value,"DM","")&
If(Role_IE.Value,"IE","")&
If(Role_Mgr.Value,"Mgr","")&
If(Role_SD.Value,"SD","")&
If(Role_SD_1st.Value,"SD 1st","")&
If(Role_SD_2nd.Value,"SD 2nd","")&
If(Role_TL.Value,"TL","")

If you want each result on a new line do this instead.

 

If(Role_DM.Value,"DM<br>","")&
If(Role_IE.Value,"IE<br>","")&
If(Role_Mgr.Value,"Mgr<br>","")&
If(Role_SD.Value,"SD<br>","")&
If(Role_SD_1st.Value,"SD 1st<br>","")&
If(Role_SD_2nd.Value,"SD 2nd<br>","")&
If(Role_TL.Value,"TL","")

 

---

Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."

Anonymous
Not applicable

Thank you very much @mdevaney,

 

That works really well. Yesterday evening however I started wondering if I was asking the correct question and I don't think i did.

 

Since I will probably need to add and remove checkboxes from my PowerApps application in the future i think i need to add them to a collection when checking them instead. Then i'll show the collection instead. That way I just need to add new checkboxes and copy the collection code in the 'onCheck' variable from another checkbox to add it.

 

Again thank you very much for your time.

Peter

That’s a very good thought to ensure easy maintainability of your code. You are correct, a single column table stored within a collection will do what you require.
Anonymous
Not applicable

@mdevaney,

 

Just wanted to show what nailed it for me. The lines below is now showing my collection column values in my html textbox.

"<Table>"&
"<tr>"&
"<th>Department</th>"&
"<th>Role(s)</th>"&
"</tr>"&
"<tr>"&
"<td>"&Department.Selected.GroupName&"</td>"& "<td>"&Concat( EmpRoles, CheckboxText & "<br>" )&"</td>"&
"</tr>"&
"<tr>"&
"<td></td>"&
"</tr>"&
"<Table>

 

Thank you very much for giving me the advice before. Smiley Happy

View solution in original post

@Anonymous
Im glad you were able to figure it out and I appreciate you taking the time to write me back. Having the solution here will be helpful in case someone else has the exact same issue.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,079)