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

Community site session details

Session Id :
Power Automate - Power Automate Mobile App
Suggested answer

Today less than Campaign End Date expression

(0) ShareShare
ReportReport
Posted on by 94
 Hi,
 
I am triggering a notification on teams if the campaign end date is less than today
 
But I am seeing the error message as mentioned below
 

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The action(s) 'CampaignEndDate' referenced by 'inputs' in action 'Condition' are not defined in the template.'.'.Upgrade
 
Below are the column values in excel that are saved in workbook
 
 
formatDateTime(utcNow(),'dd-MM-yyyy') less than 
formatDateTime(body('CampaignEndDate'),'dd-MM-yyyy')
 
Let me know if I am making any mistake here
 
Regards,
 
Sudheer
Categories:
I have the same question (0)
  • stampcoin Profile Picture
    4,084 Super User 2025 Season 2 on at
    Today less than Campaign End Date expression
     
    According to your last error message, please use :
    formatDateTime(item()?['CampaignEndDate'],'dd-MM-yyyy')
     
     
     
     
  • Suggested answer
    Tomac Profile Picture
    1,610 Moderator on at
    Today less than Campaign End Date expression
    Remove the int statement from your expression, it's not applicable here:
     
    formatDateTime(utcNow(),'yyyy-MM-dd') less than 
    formatDateTime(addDays('1899-12-30', item()?['CampaignEndDate']),'yyyy-MM-dd')
    Previous comments have suggested you're already getting an integer back from that column, but the current error suggests you're getting a string. If the above expression gives a funky date, try this one:
    formatDateTime(utcNow(),'yyyy-MM-dd') less than 
    formatDateTime(item()?['CampaignEndDate'],'yyyy-MM-dd')
    Remember that you can put a Compose right above this comparison with item()?['CampaignEndDate'] as the expression to verify the value that's returned in that variable.
  • NS-10041416-0 Profile Picture
    94 on at
    Today less than Campaign End Date expression
    Hi,
     
    After changing the expression, I am facing the error message as below
     
    formatDateTime(utcNow(),'yyyy-MM-dd') less than 
    formatDateTime(addDays('1899-12-30', int(item()?['CampaignEndDate'])),'yyyy-MM-dd')
     
    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
     
    Regards,
     
    Sudheer
     
  • Qawwam Profile Picture
    32 on at
    Today less than Campaign End Date expression
    Hello , 
    This expression you wrote compares string and not date. For example ,
    '14-07-2024' < '10-08-2024' might return false because strings compare character by character.
     
    I recommend using format 'yyyy-MM-dd' instead of 'dd-MM-yyyy' in your condition. This should fix your flow.
     
    Accept my answer if it helps.
  • stampcoin Profile Picture
    4,084 Super User 2025 Season 2 on at
    Today less than Campaign End Date expression
    The Function has a extra 'e'. My manually typed mistake. sorry about that.
     
    If you get integer value from your date (CampaignEndDate) column, use :
     
    formatDateTime(addDays('1899-12-30', int(item()?['DelDateReque'])),'dd-MM-yyyy')
     
    if you get date value,use :
    formatDateTime(item()?['CampaignEndDate'],'dd-MM-yyyy')
  • NS-10041416-0 Profile Picture
    94 on at
    Today less than Campaign End Date expression
     
    Thanks for the reply.
     
    Sorry for missing the before step i.e.
     
    First I am getting the user values from excel as below
     
    There after in the apply each loop I am setting the below condition to check if today's date is less than Campaign's End Date
    formatDateTime(utcNow(),'dd-MM-yyyy') less than 
    formateDateTime(item()?['CampaignEndDate'],'dd-MM-yyyy')
     
    But I am still getting the error message as below
     
     
    Regards,
    Sudheer
  • Suggested answer
    stampcoin Profile Picture
    4,084 Super User 2025 Season 2 on at
    Today less than Campaign End Date expression
    Not sure what you used in previous step.
     
    If you use it with Get a row , it should be like :
    formatDateTime(outputs('Get_a_row')?['body/CampaignEndDate'],'dd-MM-yyyy')
     
    If you use it within a loop, it should be like:
    formateDateTime(item()?['CampaignEndDate'],'dd-MM-yyyy')
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Featured topics