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 184
 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)
  • Suggested answer
    stampcoin Profile Picture
    5,058 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')
     
     
  • NS-10041416-0 Profile Picture
    184 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
  • stampcoin Profile Picture
    5,058 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')
  • Qawwam Profile Picture
    61 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.
  • NS-10041416-0 Profile Picture
    184 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
     
  • Suggested answer
    Tomac Profile Picture
    3,847 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.
  • stampcoin Profile Picture
    5,058 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')
     
     
     
     

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 489 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 479 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 271

Last 30 days Overall leaderboard

Featured topics