web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Comparing values

(0) ShareShare
ReportReport
Posted on by 390
Good afternoon,  I have a serious problem for weeks!

I have CALENDARIO LIST where I registered all the dates of the year, it has 3 columns: Date, Week and Month.

CALENDARIO COLUMNS.PNG

So then, I have TAREA LIST

BAAA.PNG

and I record Calendario columns with 3 dropdowns to save Month('MES'), Week('SEMANA') as a single text instead of being a lookup column but the problem is when I save the Date ('FECHA') 

EDIT FORM.PNG

It saves everything in a right way but what I need is not to allow me to register another task (TAREA) with the same 'Date', 'Service' and 'Team Member'.

I put a Lookup function:

If(
 IsBlank(
 LookUp(
 TAREA;
 'TEAM MEMBER'.Value = Input_TeamMemberTarea.Selected.Value && FECHA = Input_FechaTarea.SelectedText.Value && SERVICIO.Value = Input_Servicio.Selected.Value
 )
 );
 SubmitForm(Form_PlanearTarea)

 But it returns me and error of data matching.

ERROR 1.PNG

I changed into DateValue(Input_FechaTarea.SelectedText.Value) but it doesn't work neither:
ERROR 2.PNG

I asked this in: https://powerusers.microsoft.com/t5/Building-Power-Apps/Lookup-Function/m-p/487700#M147340  but I couldn't solve it.

I wonder if you could help me please, thanks a lot for reading.

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @JoseC12 

    I would recommend, for simplicity, to simply enable or disable (and possibly display a "date error" message, or even limit your dropdown of dates to only those dates that are not available).  In other words, why have a user fill out something and then when they submit...then get an error?  Do it before they go through the submit process by just disabling the button.

     

    So, moving forward, looking over your formulas and your prior post, it seems like you are dealing with a date conversion issue.  I do not have a sense of what the 'TEAM MEMBER' column is, but I assume it is a Lookup or Choice column since you reference it with a .Value.  The same goes for the 'SERVICIO' column since you reference it also with the .Value.  So, I'll assume that to be the case and correct.

    Consider changing your formula to this:

    If(
     IsBlank(
     Lookup(TAREA;
     'TEAM MEMBER'.Value = Input_TeamMemberTarea.Selected.Value &&
     FECHA = DateValue(Input_FechaTarea.Selected.FECHA) &&
     SERVICIO.Value = Input_Servicio.Selected.Value
     )
     );
     SubmitForm(Form_PlanearTarea);; UpdateContext({varShowCrearTarea:false, varShowMensajeConfirmacionCrearPlanTarea:true})
    )

    You seemed to show most of your issues around the Input_FechaTarea control and converting that to a DateValue, so if you still see those errors, please check the items property of that dropdown.

    ALSO...the error you saw in the other posting (your last reply) is not unusual to see.  When you do a "bad" date comparison in the designer with SharePoint, it gets into a "mode" that it will just complain on and on about it.  The answer to that is to save and close the designer, then reopen and edit the app.  If you are still doing a "bad" comparison, you will get the message again.  You'll need to fix the issue, then save, close, reopen until the error is gone.

     

    Taking the above and using my first statement about just disabling the button...you could put this in your DisplayMode property of the submit button:

    If(
     IsBlank(
     Lookup(TAREA;
     'TEAM MEMBER'.Value = Input_TeamMemberTarea.Selected.Value &&
     FECHA = DateValue(Input_FechaTarea.Selected.FECHA) &&
     SERVICIO.Value = Input_Servicio.Selected.Value
     )
     );
     Edit;
     Disabled
    )

    Then, your OnSelect of the button would be simply:

    SubmitForm(Form_PlanearTarea);; 
    UpdateContext({varShowCrearTarea:false, varShowMensajeConfirmacionCrearPlanTarea:true})
    

    There is no need to perform the lookup again in the submit because the user would never have been able to click the button if the date was in use.

     

    I hope this is helpful for you.  

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard