cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Background conditional validation of sharepoint list in powerapps

Hi all,

 

I have created an app in which i will be receiving user inputs for multiple fields ,which inturn will go to my linked sharepoint list,now what i am trying to acheive here is that when an user submits the data in powerapps,the powerapp before sumbitting it to the sharepoint list ,should check wheather the same record already exists in the sharepoint list and if it exists,it should give a warning to user and then user should be given 2 options :  either to cancel submission or to delete the previous submission and move forward with new submission is it possible ?

 

For example,Consider person A has already applied for Sick leave for 10.12.18,now the same person A/person B applies for same Sick leave for 10.12.18,my app shouldn't take data instead give a popup/warning to user asking them to delete the old data and submit new one or cancel this submission..?

 

Please help me with some workaround atleast

 

EDIT :  I was trying to use the following formula on the Onchange prop of one of text input box ,but it throws me an invalid argument error can u please help :

If(textinput.Text exactin 'SP list'.columnname && 'SP list'.anothercolumnname = "Sick Leave",Notify( "alrdy exist", NotificationType.Error ))

NOTE : This is what i am trying to acheive : 

If(DataCardValue.Text exactin 'SP list'.columnname1 && DataCardValue2.Selected.Value = ThisItem.columnname2.Value = "Sick Leave" ,Notify("abort"),Notify("proceed"))

 

8 REPLIES 8
Highlighted
Resolver I
Resolver I

Re: Background conditional validation of sharepoint list in powerapps

Hi @vish_p,

 

On my previous project I am used the condition on the "textinput" something like:

 

OnChange:If(YourTexInputName.Text exactin SPListSourcename.fieldname,Navigate(DuplicateErrorScreen, ScreenTransition.None),true, false)

Hope this help for you starting point.

Highlighted
Helper V
Helper V

Re: Background conditional validation of sharepoint list in powerapps

thanks 🙂 this actually partially helped me ,in my case i have to take input from two fields (one dropdown and one textinput) and compare it with every row of data in my SPList to know if that combo exists in any of the row and if that combo is there then warning should go to user.

like in the example qouted above type of leave and date of leave should be taken as a combo

Highlighted
Helper V
Helper V

Re: Background conditional validation of sharepoint list in powerapps

someone please help


@vish_p wrote:

Hi all,

 

I have created an app in which i will be receiving user inputs for multiple fields ,which inturn will go to my linked sharepoint list,now what i am trying to acheive here is that when an user submits the data in powerapps,the powerapp before sumbitting it to the sharepoint list ,should check wheather the same record already exists in the sharepoint list and if it exists,it should give a warning to user and then user should be given 2 options :  either to cancel submission or to delete the previous submission and move forward with new submission is it possible ?

 

For example,Consider person A has already applied for Sick leave for 10.12.18,now the same person A/person B applies for same Sick leave for 10.12.18,my app shouldn't take data instead give a popup/warning to user asking them to delete the old data and submit new one or cancel this submission..?

 

Please help me with some workaround atleast

 

EDIT :  I was trying to use the following formula on the Onchange prop of one of text input box ,but it throws me an invalid argument error can u please help :

If(textinput.Text exactin 'SP list'.columnname && 'SP list'.anothercolumnname = "Sick Leave",Notify( "alrdy exist", NotificationType.Error ))

NOTE : This is what i am trying to acheive : 

If(DataCardValue.Text exactin 'SP list'.columnname1 && DataCardValue2.Selected.Value = ThisItem.columnname2.Value = "Sick Leave" ,Notify("abort"),Notify("proceed"))

 


 

Highlighted
Helper V
Helper V

Re: Background conditional validation of sharepoint list in powerapps

Any help on this will be appreciated 🙂

Highlighted
Community Support
Community Support

Re: Background conditional validation of sharepoint list in powerapps

Hi @vish_p

How you submit your form data within your app? using SubmitForm function or Patch function?

Based on the formula that you provided, I think there is something wrong with it.

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the "Submit" button within your app to following:

 

If(
   !IsBlank(LookUp('YouSPList', ColumnName1 = DataCardValue1.Text)) && !IsBlank(LookUp('YourSPList', ColumnName2.Value = DataCardValue2.Selected.Value)),
Notify("The same record has been existed within the SP list, you could consider cancel submission or delete previous submission and submit new one"),
SubmitForm(EditForm1) /* <-- EditForm1 represents the Edit form in your app */
)

In addition, if you want to compare three columns (one Text input box, one Combo box, one DatePicker) with each row in your SP list, please check the following article:

If(
   !IsBlank(LookUp('YouSPList', ColumnName1 = DataCardValue1.Text)) && 
!IsBlank(LookUp('YourSPList', ColumnName2.Value = DataCardValue2.Selected.Value)) &&
!IsBlank(LookUp("YourSPList", Text(DateColumn,"[$-en-US]mm/dd/yyyy") = Text(DatePicker1.SelectedDate,"[$-en-US]mm/dd/yyyy"))), Notify("The same record has been existed within the SP list, you could consider cancel submission or delete previous submission and submit new one"), SubmitForm(EditForm1) /* <-- EditForm1 represents the Edit form in your app */ )

More details about the LookUp function in PowerApps, please check the following article:

LookUp function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper V
Helper V

Re: Background conditional validation of sharepoint list in powerapps

Thanks for the reply 🙂
Actually in the formula shared by you ,i wanted to check wheather the splist.column2 = selected.value = "New Link".So the formula should look something like :

 

If(
!IsBlank(LookUp('YouSPList', ColumnName1 = DataCardValue1.Text)) && !IsBlank(LookUp('YourSPList', ColumnName2.Value = DataCardValue2.Selected.Value = "New Link")),
Notify("The same record has been existed within the SP list, you could consider cancel submission or delete previous submission and submit new one"),
SubmitForm(EditForm1) /* <-- EditForm1 represents the Edit form in your app */
)

Is it possible to do that ? Coz when i tried that it shows me some invalid argument error

Highlighted
Community Support
Community Support

Re: Background conditional validation of sharepoint list in powerapps

Hi @vish_p,

I think there is something wrong with the formula that you provided.

The formula " splist.column2 = selected.value = "New Link" " is not supported within PowerApps. Please take a try to modify your formula as below:

If(
!IsBlank(LookUp('YouSPList', ColumnName1 = DataCardValue1.Text)) && 
!IsBlank(LookUp('YourSPList', ColumnName2.Value = "New Link" && DataCardValue2.Selected.Value = "New Link")), Notify("The same record has been existed within the SP list, you could consider cancel submission or delete previous submission and submit new one"), SubmitForm(EditForm1) /* <-- EditForm1 represents the Edit form in your app */ )

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper V
Helper V

Re: Background conditional validation of sharepoint list in powerapps

I tried this also,but nothing happened as soon as i click on submit nothing happens,also i got a delegation warning for using lookup.

Actually my requirement here is when i receive data from user i need take data from one data card and compare it with values of one column in sharepoint list if there is a hit then i need to check the records for all the hit has happened and compare another drop down value  (i.e New Link) with another column value of that particular record in splist to check wheather it matches wth powerapp data (i.e New Link)

 

Note : the value i.e. "New Link" i am comparing here with a dropdown column,so i am gettting an invalid argument error also

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,919)