![]() The above expression formula will reverse the order of the array and then join the results with the dash character. This is a more elegant approach to creating the date in the proper format. ![]() Then you can use the join function to concatenate the components with a dash. This means, you can use the reverse function to put them in the order needed. In this example, the year, month, and day componentent in the array are in reverse order to which you need to join them. These are all combined with a dash character - between them to create the date in the proper format. The year is the third item in the array so this has an index of 0 and will access this value.The month is the second item in the array so this has an index of 1 and will access this value.The year is the third item in the array so this has an index of 2 and will access this value.The above formula will combine the year, month, and day from the array created in the Parse compose action. You can joining these all together using the concat function and using the index number to get the values of the array. Now that you have each of the day, month, and year components in an array you will be able to join them in the required yyyy-MM-dd format. Join Day, Month, and Year Components into a Date The above expression will take the full date time string and return this array in the Compose action named Parse. Now you can use the split function again based on the forward slash / character to get an array with the day, month, and year. In this example, it will return the string. The above expression will get just the date part of the datetime string. You can use the split function to split the date and time based on the space character into an array with two items and then get the first item using the index. This converts the string into an array based on a delimiter. This can be done with the split function. Since the example date has both a date and time component, the first step will be to get only the date part of the string. This means you will need to parse your date and rearrange it into the correct format. The DateTime string must match ISO 8601 format which is yyyy-MM-dd. Unfortunately, if you try to use this as a date in Power Automate you will get an error telling you the provided date time string is not valid. This is a very common date format used by a lot of people around the world. In this example, there is a date inside a Compose action named Date String. This post is going to show you ways to turn a string to a date in Power Automate. If you want to perform any manipulation such as formatting the date or adding days to the date, then you will first need to convert the text to a date that Power Automate will recognize. Sometimes you might come across data that looks like a date but is actually a text string in Power Automate. Do you need to convert a string value to a date in your flow?
0 Comments
Leave a Reply. |