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."
Check out the News & Announcements to learn more.
Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.