Skip to main content

Notifications

Community site session details

Community site session details

Session Id : +7Q0WFM5DU0f7aSg1BcZ/a
Power Apps - Building Power Apps
Unanswered

Background conditional validation of sharepoint list in powerapps

Like (0) ShareShare
ReportReport
Posted on 23 Nov 2018 05:37:52 by 287

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"))

 

  • vish_p Profile Picture
    287 on 30 Nov 2018 at 06:29:23
    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

  • v-xida-msft Profile Picture
    on 28 Nov 2018 at 09:59:54
    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

  • vish_p Profile Picture
    287 on 28 Nov 2018 at 08:22:06
    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

  • v-xida-msft Profile Picture
    on 28 Nov 2018 at 06:01:19
    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

     

  • vish_p Profile Picture
    287 on 26 Nov 2018 at 12:53:14
    Re: Background conditional validation of sharepoint list in powerapps

    Any help on this will be appreciated 🙂

  • vish_p Profile Picture
    287 on 25 Nov 2018 at 06:18:33
    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"))

     


     

  • vish_p Profile Picture
    287 on 23 Nov 2018 at 13:51:01
    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

  • daroot Profile Picture
    116 on 23 Nov 2018 at 10:49:59
    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard