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
Memorable Member
Memorable Member

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
Memorable Member
Memorable Member

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

abm
Super User III
Super User III

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,876)