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."
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
Fill out a quick form to claim your user group badge now!
Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities
Features releasing from October 2019 through March 2020
Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.
Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications