cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jo_25
Helper I
Helper I

Concat date column in sharepoint list

Hi, 

I have 2 sharepoint date -ContractStartDate and ContractEndDate which are displayed as ddmmyyyyy in the list view. However, when I tried to concat these 2 fields as the new sharepoint folder name, Flow used ContractStartDate and ContractEndDate in mmddyyyy, The concat formula I used is as follows:

 

concat(variables('varStaffName'),'-',triggerOutputs()?['body/ContractStartDate'],'-To-',triggerOutputs()?['body/ContractEndDate'])

 

Would appreciate any help on how to make  the concat formula used ContractStartDate and ContractEndDate as ddmmyyyy instead. 

 

 

4 REPLIES 4
ekarim2020
Community Champion
Community Champion

Try using formatDateTime function to format the date outputs: formatDateTime('<timestamp>', 'ddMMyyyy')

 

 

formatDateTime(utcNow(), 'ddMMyyyy')

"2021-07-04T12:07:24.1117051Z" returns 04072021.

 

and

 

formatDateTime(triggerOutputs()?['body/ContractStartDate'], 'dd-MM-yyyy')
formatDateTime(triggerOutputs()?['body/ContractStartEnd'], 'dd-MM-yyyy')

 

 

 

You may also want to check the Regional settings of the SharePoint site to ensure it matches your requirements:

ekarim2020_2-1625399918264.png

Ellis

 

Hi, Ellis

Thanks for your help. Site Settings > regional was set correctly to the timezone I am in. 

I tried formatDateTime to format output but I encountered this error during runtime.  The expression I used is as follows. Did I missed any step?

 

concat(variables('varStaffName'),'-',formatDateTime(triggerOutputs()?['body/ContractStartDate'],'dd-MM-yyyy'),'-To-',formatTimeDate(triggerOutputs()?['body/ContractEndDate'],'dd-MM-yyyy'))

Jo_25_0-1625435851156.png

Jo_25_1-1625436329162.png

 

ekarim2020
Community Champion
Community Champion

Could you post a screenshot of the actual expressions used in Initialize varFolderName1.

 

The flow could be corrupt. Can you try recreating new flow from scratch solve the issue (use the ‘Save As’ feature to save a new Flow may fix it too).

 

Ellis

Hi @Jo_25 

 

The error you getting is related to a typo. You are using a wrong expression. See below expression in bold formatTimeDate. There is no such expression in flow called formatTimeDate. Change this to formatDateTime.

 

concat(variables('varStaffName'),'-',formatDateTime(triggerOutputs()?['body/ContractStartDate'],'dd-MM-yyyy'),'-To-',formatTimeDate(triggerOutputs()?['body/ContractEndDate'],'dd-MM-yyyy'))

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,188)