Read SharePoint List and Converst String to Date

%3CLINGO-SUB%20id%3D%22lingo-sub-2717496%22%20slang%3D%22en-US%22%3ERead%20SharePoint%20List%20and%20Converst%20String%20to%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2717496%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3EI%20would%20like%20to%20do%20following%20task%3A%3C%2FP%3E%3CP%3E1.%20Read%20a%20SharePoint%20List%20with%20a%20date-column%20(formatted%20as%20string)%3C%2FP%3E%3CP%3E2.%20Convert%20the%20data%20within%20this%20column%20into%20date%20(dd.MM.yyyy)%3C%2FP%3E%3CP%3E3.%20Compare%20it%20with%20the%20actual%20date%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20you%20have%20an%20example%20or%20a%20hint%20how%20to%20do%20that.%3C%2FP%3E%3CP%3EEvery%20line%20of%20the%20sharepoint%20list%20should%20be%20read%20and%20the%20column%20compared%20with%20the%20actual%20date.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJFM_12%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2717496%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2723880%22%20slang%3D%22en-US%22%3ERe%3A%20Read%20SharePoint%20List%20and%20Converst%20String%20to%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2723880%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F244615%22%20target%3D%22_blank%22%3E%40JFM_12%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20Flow%20you%20can%20fulfill%20your%20requirement%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22suvi15_0-1630916433538.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F308268i3A31F4BC1434DC33%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22suvi15_0-1630916433538.png%22%20alt%3D%22suvi15_0-1630916433538.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHere%20i%20used%20trigger%20option%20as%20When%20item%20created%20but%20if%20you%20don't%20want%20to%20use%20this%20option%20then%20there%20is%20Recurrence%20(Timer)%20option%20which%20you%20can%20set%20to%20trigger%20min%2Fsec%2Fhr%20option%20to%20trigger%20comparison.%3C%2FP%3E%3CP%3Efor%20Formatting%20date%20(Compose%20step)%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EformatDateTime(triggerOutputs()%3F%5B%3C%2FSPAN%3E%3CSPAN%3E'body%2FTestDate'%3C%2FSPAN%3E%3CSPAN%3E%5D%2C%3C%2FSPAN%3E%3CSPAN%3E'dd-mmm-yyyy'%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3EI%20hope%20this%20helps%20for%20you.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2725059%22%20slang%3D%22en-US%22%3ERe%3A%20Read%20SharePoint%20List%20and%20Converst%20String%20to%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2725059%22%20slang%3D%22en-US%22%3EHello%20Suvi-15%3CBR%20%2F%3EThank%20you%20very%20much.%3CBR%20%2F%3EI%20am%20getting%20an%20Excel-List%20that%20is%20read%20from%20flow%3CBR%20%2F%3EBut%20the%20column%20is%20stored%20as%20string.%3CBR%20%2F%3ENeed%20to%20convert%20it%20to%20date%20and%20compare%20it%20with%20a%20date.%3CBR%20%2F%3EIs%20this%20possible%3F%3CBR%20%2F%3ERegards%3CBR%20%2F%3EJFM_12%3C%2FLINGO-BODY%3E
Contributor

Hello

I would like to do following task:

1. Read a SharePoint List with a date-column (formatted as string)

2. Convert the data within this column into date (dd.MM.yyyy)

3. Compare it with the actual date

 

Do you have an example or a hint how to do that.

Every line of the sharepoint list should be read and the column compared with the actual date.

 

Thank you 

 

JFM_12

9 Replies

Hi @JFM_12 ,

 

Using Flow you can fulfill your requirement 

suvi15_0-1630916433538.png

Here i used trigger option as When item created but if you don't want to use this option then there is Recurrence (Timer) option which you can set to trigger min/sec/hr option to trigger comparison.

for Formatting date (Compose step)

formatDateTime(triggerOutputs()?['body/TestDate'],'dd-mmm-yyyy')
I hope this helps for you.

@suvi-15  your formatDateTime is incorrect as in Power Automate months are formatted with capital Ms. Lowercase ms are for minutes.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hello Suvi-15
Thank you very much.
I am getting an Excel-List that is read from flow
But the column is stored as string.
Need to convert it to date and compare it with a date.
Is this possible?
Regards
JFM_12

Hi RobElliot
Thank you.
I know changed it to MM but still does not work.
Thank you
Regards
JFM_12

Hello
I tried to use this as formula:
addDays('30-12-1899',int(items('Auf_alle_anwenden')?['Start Date']),'dd-MM-yyyy')
But got following error:
" InvalidTemplate. Unable to process template language expressions in action 'Start Date' inputs at line '1' and column '2795': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'. "
I know there are many of this posts.
Read them but....
JFM_12

@JFM_12 your first post said you were using a SharePoint list but now you are talking about getting the dates from Excel. Which is it as it affects the answer?

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hi @JFM_12 ,

 

as you proceed this much i think you must be already using action for Excel(file may be present in Sharepoint Documents or actual loaction).

 

addDays('30-12-1899',int(items('Auf_alle_anwenden')?['Start Date']),'dd-MM-yyyy') in this what exactly you were trying to do because if i understood correctly [Start Date] must be date format and you are trying to convert it to int which results error.(The template language function 'int' was invoked with a parameter that is not valid)

at place of items('Auf_alle_anwenden')?['Start Date'] use integer value.

Hello Everbody
Thank you for your replies. Sorry for the confusion.
At the beginning and excel is sind to a sharepoint library (Date is string)
The Excel is stored in the format of a table.
This Excel is the filled in a sharepoint list
Now the column on that list is a string. I would like to fill the column as date format (dd.MM.yyyy).
I omitted this, sorry.
Regards
JFM_12
Hello Everybody
Thank you for your answers.
I was able to resolve it.
Have great days.
JFM_12