I created a list on SharePoint Online and clicked on customize it in PowerApps: the list has 2 date/time columns with date and hour showed; in PowerApps these are represented with datepicker for date and dropdowns for hour and minutes; I'd like to set some validation rules on hours but I can't understand where to do it; my first question is: when in SharePoint I click in Save, what PowerApps action is raised in the "SharePointIntegration" control? I supposed it is "OnSave" so I tried to do some test on it but without luck.
What I like to have is some rules when the user choose an hour value and if it is, for example, greater than another value, I can't save the form.
It is simplistic as explanation but I don't find where to start and where are the action or properties that I can modify.
If you're end goal is not letting the user submit the form based on a condition then you would do that on the OnSave property. What formula were you using in your OnSave function? Did you get an error and if so what error did you get?
to do a test I tried this: my field was called "HourValue1" when I created the integration in SPO, so I tried something similar to
If((HourValue1.value) > 9; "There is an error"; SubmitForm(SharePointForm1))
but when I write this I have a green color around the HoudValue1 and the message say that argument type is not valid and that a number is expected; I also tried HourValue1.Selected but it doesn't work: I suppose that an if inside that declaration is not valid.
Is HourValue1 the name of the control on the screen and if so, what kind of control is it?
HourValue1 in PowerApps is a dropdown box; in SharePoint, I have a date/time column and the format include Date and Hour (like in the image, sorry the language you see is italian):
When I personalized the new form in SharePoint, PowerApps created the form page and set a datepicker for date and 2 dropdown boxes, one for hour and the other for the minutes (as in the images for date and hour):
Now, I even tried tried with the formula:
If((Value(HourValue1.Selected.Value)) > 9; "There is an error"; SubmitForm(SharePointForm1))
on the OnSave action and it seems that it is accepted without any error, but when I fill the fields in SharePoint it save it like there is no control on this if; maybe I can create a label inside the form and set the visible property to true when the result of the if statement is True but how to block the save?
Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round