Using Validate function in Powerapps - sharepoint-online

I have a Sharepoint online list with fields Sun, Mon and RatePerJob. The RatePerJob is mandatory. Either Sun or Mon must have a value. All fields are numeric.
In the list settings I have this validation formula.
=AND(AND(RatePerJob>0,RatePerJob<50),OR(Sun>0,Mon>0))
I have a powerapp with a gallery and form linked to the Sharepoint list.
I want to avoid having to write lots of validation code in the powerapp.
How can I use the validate function in powerapps to submit the form if it's valid and to display an error message otherwise?

Set the OnSelect property of the button as shown below:
If(Value(DataCardValue4.Text)>0 And Value(DataCardValue4.Text)<50 And (Value(DataCardValue2.Text)>0 Or Value(DataCardValue3.Text)>0),
SubmitForm(Form1),
Notify("ErrorTest", NotificationType.Error)
)
Note,DataCardValue4 is the datacard of RatePerJob column, DataCardValue2 and DataCardValue3 are the datacards in the Sun and Mon columns respectively.
You could also change the related datacard name more user friendly.

Related

Making Date Field “Required” in SharePoint 2013 List breaks custom List Form Validation

I have a custom new form for SharePoint 2013 List which has multiple required field and when I click on Submit, validation of form works fine and if any mandatory field is blank,it shows error in red "You must specify a value for this required field."
Issue is If I mark DateTime field as mandatory then mandatory validation is not working properly.It is not validating all mandatory fields and showing message in red on submitting/adding new record. This is issue only when using custom form,not in default newform.aspx.
I saw similar issue here but not proper answer why this is occuring and how to resolve?
Because, the system will check if the datetime field empty first, then check for others, if you set a value for this datetime field and check the save button, if other mandatory fields empty, they will also show the error message below the field.
As a workaround, we can set default value for the DateTime field in field settings.

Creating a Dropdown list based in another field in same form - Sharepoint 2013 List

Guys!
I have a Sharepoint List, and I'm struggling to customize the webpart to include a new Item.
The need is to create a Dropbox that changes values based in another field in same webform.
Here in this list, I select the Coordinator list, but the problem is I really don't know how to show in Analyst field just the analysts from the coordinator I just choose.
Note: We are using a workspace in Sharepoint 2013, and due adm restrictions we can only use the regular settings, so we can't create custom HTML webparts for example.

Unable to save new record to the sharepoint list

I am creating a leave system for my company through Sharepoint. I tried customizing the edit form using powerapps. So when I fill all the records in edit form as shown in powerapp.png, and click on save button as in normal sharepoint form, my fields get reset to their defaults and i get 'entry required or invalid value'(see the attachment named 'powerapp.png') and the item isn't added to my sharepoint list.
However the record does get added to list if using normal sharepoint form as shown in normal_sharepoint.png.
Note: I have created a custom text field in powerapp.png which calculates me the leave days excluding weekdays and weekends. ( this is a major requirement)
Also I have enabled content-approval in my sharepoint list because the item is sent to manager for approval. Hence a content-type data field equal to 'Item' always shows up when I open the edit form in normal sharepoint and some unique id is autogenerated. However I enabled the content type field in powerapps too but still the same error.
powerapp.png
normal_sharepoint.png
You need to ensure you have filled out all the fields as those asterisked are Required fields.
Also on the datacard of each of the fields on powerapps, you can change the required property to false if any of the fields is not cumpolsory

InfoPath 2013 unable to change table to repeating table

I'm trying to create a table with a repeating row in InfoPath 2013 (editing a Sharepoint 2013 custom list in case that matters). I'm unable to post a screenshot of the table to show you, but it is a 2-row, 2-column table with text in the first row, a Date/Time field in the 1st column of the 2nd row, and a text field in the 2nd column.
When trying to create this repeating table, I'm getting a prompt that says "InfoPath cannot automatically create a field or group in the section containing this control. To set the binding, select a field or group in which to store the control's data:" (I would post a screenshot of this too, but reputation is too low)
Any ideas as to why this is happening? I'm having trouble finding out exactly how repeating controls work in InfoPath and how to create them.

How can I filter a Sharepoint 2007 libarry list based on current user login?

I would like to know how I can filter a SharePoint library list based on current user login.
Suppose I have created the followings:
1) A SharePoint form library containing bunch of uploaded InfoPath form data.
2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.
I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.
I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value to that of "TargetUser".
I tried using other text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepted the parameter without any error but the resulting fitlered list does not display any items at all.
I have googled this subject but I have not found any solution.
It would be greatly appreciated if anyone can help me to create a functional filtered list.
And FYI, my SharePoint 2007 installation is just WSS 3.0 + Form Server. I do not have MOSS 2007 (so no MOSS 2007 web parts or web services).
Thank you.
Jason
Is there any reason your TargetUser field is a text field instead of a People or Group field?
The [Me] identifier can be used to filter list items based on a People or Group column, but not on text fields.
Well. It looks like no one here has the answer.
Nevertheless, another user on Technet forum has a very good solution.
See this link for more information

Resources