I am trying to bring in a validation if the tag ID is entered more than once on the same daY and this is my code. The value is always false. Please suggest a workaround.
UpdateContext(
{
tagexists: If(
LookUp(
'[GLOBUS_APP].[T5007_RETURNS_LOG_DETAIL]',
C5010_TAG_ID = txtTagNumber.Text && Text(DateAdd(C5007_PROCESSED_DATE,TimeZoneOffset(),Minutes),"[$-en-US]mm/dd/yyyy") = Text(DateAdd(Today(),TimeZoneOffset(),Minutes),"[$-en-US]mm/dd/yyyy") ,
true
),
true,
false
)
}
);
Hi @sshiny ,
Firstly, you do not need the If/true/false when setting a Boolean Variable and I have also not considered your data logic as I am not clear on the Text/TimeZoneOffset, however you need to test if the lookup returns any records
UpdateContext(
{
tagexists:
!IsBlank(
LookUp(
'[GLOBUS_APP].[T5007_RETURNS_LOG_DETAIL]',
C5010_TAG_ID = txtTagNumber.Text &&
Text(DateAdd(C5007_PROCESSED_DATE,TimeZoneOffset(),Minutes),"[$-en-US]mm/dd/yyyy") =
Text(DateAdd(Today(),TimeZoneOffset(),Minutes),"[$-en-US]mm/dd/yyyy"
)
)
}
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@WarrenBelz Eventhough there is a tag number in todays date it is returning false
@sshiny ,
As I noted, I had not considered your logic as I was unsure what you were doing with the text conversion in the dates and timezone offset - I would normally approach it something like this
UpdateContext(
{
tagexists:
!IsBlank(
LookUp(
'[GLOBUS_APP].[T5007_RETURNS_LOG_DETAIL]',
C5010_TAG_ID = txtTagNumber.Text &&
IsToday(C5007_PROCESSED_DATE)
)
)
}
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @sshiny ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@sshiny ,'
You could try this with a field value
UpdateContext(
{
tagexists:
!IsBlank(
LookUp(
'[GLOBUS_APP].[T5007_RETURNS_LOG_DETAIL]',
C5010_TAG_ID = txtTagNumber.Text &&
IsToday(C5007_PROCESSED_DATE)
).C5007_PROCESSED_DATE
)
}
)
but the syntax will return true if you have a record in '[GLOBUS_APP].[T5007_RETURNS_LOG_DETAIL]' where C5010_TAG_ID equals the Text Box txtTagNumber AND C5007_PROCESSED_DATE is the current date. Please check your data to see if this is the issue.
Hi @sshiny ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |