I am trying to make a form to check whether the food has expired. In the form there are 2 datacard: "Has Expired" and "Expiry Date".
The "Expiry Date" datacard will be only visible if user select "Yes" for "Has Expired" datacard. This form will be submitted and the data will be stored in sharepoint list. Then, user can view the form that they have submit.
The problem I am facing is that when the user select "No", the sharepoint list still update the default date. How to make it empty?
1. I have tried to clear the date inputtextholder properties. However, this also cleared the date enter by user when they select "Yes", when they view the form.
p/s: I am still new in PowerApps. Hope the experts can help me.
Solved! Go to Solution.
I would suggest using this code in the Update property of your DataCard for ExpiryDate. When the Has Expired toggle shows "Yes" the selected expiry date will be updated in Sharepoint and when "No" the expired date will be updated as a blank field.
If( toggle_HasExpired.Value=True, DataCardValue_ExpiryDate.SelectedDate, Blank() );
Another tip: it would be a good idea only to show the Expiry Date datepicker when Has Expired is True. To do that put this code in the Visible property of the Expiry Date datacard.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Featuring samples like Return to the Workplace and Emergency Response Applications
We're excited to announce our first cross-community 'Can You Solve These?' challenge!
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
We are excited for the next Super User season.
FIll out a quick form to claim your community user group member badge today!
Features releasing from October 2020 through March 2021