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 Platform Community / Forums / Power Automate / Excel date value keeps...
Power Automate
Answered

Excel date value keeps changing between date type and int

(0) ShareShare
ReportReport
Posted on by 33

I have a flow that reads a document with AI, one of the variables that it extracts is a date and i need to add business days to this date. When i try to add these days treating the date as a date, there's an issue which says 'In function 'addDays', the value provided for date time string '45309' was not valid. The datetime string must match ISO 8601 format.'. So right, date is seen as an int in operations apparently, so i go with that and make a solution for the int case which involves using the function int() on the previous date, but whenever i do that it seems to change to a date because then i get this error 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'. So now that's a date... I'd like to know a way for it to stay int or date. I've tried specifying on every excel action the date format being ISO 8601, and i'm not sure how the number works to show a date, since in the excel document it succesfully shows as a date.

 

EDIT: Here's the output for each case on the last excel action before i try to add business days:

'Fecha sobre' as an int'Fecha sobre' as an int'Fecha sobre' as a date'Fecha sobre' as a date

Categories:
I have the same question (0)
  • Verified answer
    The21k Profile Picture
    33 on at

    Yey i fixed it apparently, what i did was make a function for both cases in a compose action, which is the following:

    if(isInt(body('Update_a_row')?['Fecha sobre']), addDays('1899-12-30', int(body('Update_a_row')?['Fecha sobre']), 'g'), body('Update_a_row')?['Fecha sobre'])

    So this checks if 'Fecha sobre' value is an int, if it is it makes an operation with that int, if it isn't it just returns the date. Btw i tried doing this but there was an error about invalid parameters in a 'for each' thats like so far from the compose action, so with the aid of Chat GPT i corrected this unknown error. Hope this helps somebody.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard