cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Date Condition Error After Change to Data Source

I had a Gallery that auto-populated fields based on a Dropdown. I changed my data sources and broke some formulas; two are shown below. 

 

There are two hidden fields (HiddenLookupDaystoRenewal and HiddenLookupComplianceStatus)

 

There error message I get reads: "Invalid Number of Arguements; Received 3; Expected 1-2.

 

If( LookUp( DaystoRenewalCollection, ClassTitles = ThisItem.CQTitle ).DaysToRenewal = 0, "Certified", DateDiff( DateValue(ThisItem.DteofCQ), Today(), Days ) > LookUp( DaystoRenewalCollection, ClassTitles=ThisItem.CQTitle ).DaysToRenewal || IsBlank(ThisItem.DteofCQ), "Noncompliant", "Compliant")

 

          There error message I get reads: "Invalid Number of Arguements; Received 3; Expected 1-2.

 

If( LookUp( DaystoRenewalCollection, ClassTitles = ThisItem.CQTitle ).DaysToRenewal = 0, "Certified", DateDiff( DateValue(ThisItem.DteofCQ), Today(), Days ) > LookUp( DaystoRenewalCollection, ClassTitles=ThisItem.CQTitle ).DaysToRenewal || IsBlank(ThisItem.DteofCQ), "Noncompliant", "Compliant")

 

        There error messages I get read: Invalid Argument Type (Date). Expecting a Text Value Instead.

                                                             The Function 'DateValue' has some Invalid Arguments. 

 

3csman_0-1601583420885.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

@Anonymous ,

Assuming from the error message that DteofCQ is a date field, try this - I have also added some brackets which may fix the argument number error

If(
   LookUp( 
      DaystoRenewalCollection, 
      ClassTitles = ThisItem.CQTitle
   ).DaysToRenewal = 0, 
   "Certified", 
   (   
      DateDiff(
         ThisItem.DteofCQ, 
         Today(), 
         Days 
      ) > 
      LookUp( 
         DaystoRenewalCollection, 
         ClassTitles=ThisItem.CQTitle 
      ).DaysToRenewal 
   )|| 
   Value(ThisItem.DteofCQ)=0, 
   "Noncompliant", 
   "Compliant"
)

 

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.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

@Anonymous ,

Assuming from the error message that DteofCQ is a date field, try this - I have also added some brackets which may fix the argument number error

If(
   LookUp( 
      DaystoRenewalCollection, 
      ClassTitles = ThisItem.CQTitle
   ).DaysToRenewal = 0, 
   "Certified", 
   (   
      DateDiff(
         ThisItem.DteofCQ, 
         Today(), 
         Days 
      ) > 
      LookUp( 
         DaystoRenewalCollection, 
         ClassTitles=ThisItem.CQTitle 
      ).DaysToRenewal 
   )|| 
   Value(ThisItem.DteofCQ)=0, 
   "Noncompliant", 
   "Compliant"
)

 

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.

Anonymous
Not applicable

The 'Days to Renewal' should be a counter that displays the number of days until Member is Noncompliant. Its should be less one day everyday that clicks by.

 

As formatted with your suggested formula it displays the total number of days to in the compliance period (365).

 

I formula should work as a countdown. Everyday until the Days to Renewal is reached; at which point the Compliance Status would change from 'Compliant' to 'Noncompliant'.

 

This is what is currently in the Days to Renewal -

 

    "<sb>Days to Renewal: </b> <font color=blue>" &

    LookUp(DaystoRenewalCollection,ClassTitles=ThisItem.CQTitle).DaysToRenewal

 

3csman_0-1601606289425.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,406)