I have a powerapp form that i am using a toggle with Yes or No. If the user selects yes they need upload an attachement. How can i achive that? Any help will be appreciated.
Solved! Go to Solution.
One way to do it using the UpdateContext() function to create a context variable and use it in the Visible property of the Attachments control. In the OnCheck property of the Toggle
and in the OnUnCheck property of the Toggle
Change the visible property of the Attachments control to showattach. In this case, the Attachment control will not be visible unless the Toggle checked.
To prevent the user from saving a form with the toggle set to Yes and no resume attached, you could set the visible property of the button that saves the form to
If(Toggle1.Value=true && IsBlank(Attachment1.Attachments),false,true)
(Assuming the name of the Attachment control is Attachment1.)
Hi @patty789 ,
You could set below formula in the DisplayMode property of the attachment data card:
@Drrickryp Thank you for your response. Howerver i tried that formula you mention below but it did not worked with my test i still can submit the form when i don't attach a resume.
You need to put the formula in the Visible property of the Button that submits the form. That way the button will be hidden if the user sets the toggle to true and there is no attachment in the attachment control. If the button is not visible it will not be possible to submit your form. Mona's alternative will enable the attachment control but not prevent the form from being saved if nothing is attached.
Hi @Drrickryp i do have that formula on the visible property on my Submit button that saves the form, but it still saves the form without the attachement being there not sure why it still does not work. Here on the picture it shows that i have selected the Submit button and it shows the formula you provided.
Check it out!
Check it out!
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
The largest Power BI, Power Platform, and Data conference in New Zealand