Hi all,
its pretty simple to make fields required as long as you use standard form, but once i use cascading dropdowns from other souces i must use "Collect"... the formula looks like this:
Collect( 'Organisational change', { 'Reason for change': reason.Text, 'Search User': user.Selected, 'New address of your workplace': work_field.Selected } ); ResetForm(SharePointForm1) && Navigate(Screen1, ScreenTransition.CoverRight)
the problem is that field validation is ignored, i could change the last line from ResetForm to submitform and receive validation but this would still not validate the cascading dropdowns and it would submit the form twice (once with collect and once with submitform code (so without cascading dropdowns...)).
any ideas?
Solved! Go to Solution.
Yes, of course I can explain. Sorry if my last post was a bit rushed.
Lets say you only want to validate a Text Input field...
Not(IsBlank(inputField.Text))
... only if a Toggle is set to true...
toggle.Value=True
...then because we want to check if both conditions are True we put them within the AND function...
And(Not(IsBlank(inputField.Text)), toggle.Value=True)
...and finally if both conditions are met we want to add to the collection
If( And(Not(IsBlank(inputField.Text)), toggle.Value=True), If( validationCheck, Collect( 'Organisational change', { 'Reason for change': reason.Text, 'Search User': user.Selected, 'New address of your workplace': work_field.Selected } ) );
Hopefully this all makes sense!
---
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."
When using the COLLECT function it will be necessary to write your own validation code. As an example, here's how I would check if each field is filled before inserting the new record.
If( And( Not(IsBlank(reason.Text)), Not(IsBlank(user.Selected)), Not(IsBlank(work_field.Selected)) ), Set(validationCheck,True), Set(validationCheck,False) ); If( validationCheck, Collect( 'Organisational change', { 'Reason for change': reason.Text, 'Search User': user.Selected, 'New address of your workplace': work_field.Selected } );
I actually don't mind writing my own validation code because I have greater control over the data being inserted.
---
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."
thanks for that one problem i see is that many fields have custom visibility, hence if user chooses one field another might appear... i used below code for "visible properety" as well as for "required property".
If(what2change.Selected.Value = "Department and manager", true, false)
Are you saying your issue is solved? If yes, please mark the post as closed.
@mdevaney no no, what i mean is that there are for example 6 Fields, but depending on the choice of one of them other fields will appear or hide... so i guess that the controll you suggested would check also the fields that will be hidden, hence the user would not be possible to complete the form
My example is only a general example. The intention was for you to take the concept I showed and adapt it to your own situation. It is definitely possible to make a validation check conditional on whether specific fields are selected. Check out this code as an example...
If(And(Not(IsBlank(inputField.Text)),toggle.Value=True,True,False)
@mdevaney can you please explain what i am looking at, sorry but i am quite new to this
If(And(Not(IsBlank(inputField.Text)),toggle.Value=True,True,False)
Yes, of course I can explain. Sorry if my last post was a bit rushed.
Lets say you only want to validate a Text Input field...
Not(IsBlank(inputField.Text))
... only if a Toggle is set to true...
toggle.Value=True
...then because we want to check if both conditions are True we put them within the AND function...
And(Not(IsBlank(inputField.Text)), toggle.Value=True)
...and finally if both conditions are met we want to add to the collection
If( And(Not(IsBlank(inputField.Text)), toggle.Value=True), If( validationCheck, Collect( 'Organisational change', { 'Reason for change': reason.Text, 'Search User': user.Selected, 'New address of your workplace': work_field.Selected } ) );
Hopefully this all makes sense!
---
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."
User | Count |
---|---|
137 | |
127 | |
75 | |
72 | |
69 |
User | Count |
---|---|
220 | |
135 | |
78 | |
58 | |
54 |