cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel1973
Level: Powered On

Convert text from Forms to date before adding a row to Excel

Hi all

I'm a newbie and have the follwing setup:

A progress tracking form and the user can select a month provided as options "01.01.2019" "01.02.2019". 

Now this stored as text. Then I have a flow that adds a row to an Excel sheet when a new form is entered.

I like to convert this text string to a date before sending to Excel....but how 🙂 I want avoid doing this when in Excel..

 

Hope someone can solve this I presume easy task...

 

Thanks 

Daniel

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft
Level 10

Re: Convert text from Forms to date before adding a row to Excel

Hi Daniel,

I was glad to hear that,If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Zhongys

View solution in original post

7 REPLIES 7
v-zhos-msft
Level 10

Re: Convert text from Forms to date before adding a row to Excel

Hi Daniel1973,

According to your description, what your purpose is to convert the text string to a date before insert into Excel.

I have made a flow for your scenario, please check it for a reference.

As you say the options are like: "01.01.2019" "01.02.2019"

First, I use the Compose action to split the String, the expression is : split(body('Get_response_details')?['Month'],'.')

Second, I use the Compose action to convert the string to Date format., the expression is : concat(outputs('Compose')[2],'/',outputs('Compose')[1],'/',outputs('Compose')[0])

2.png3.png

Please feel free post back if you need more help.

Best regards,

Zhonys

Daniel1973
Level: Powered On

Re: Convert text from Forms to date before adding a row to Excel

Hello Zhonys

Thank your for your help. I'm understanding the process, at least.

Now I get an error message in the first compose, where the supposed string is splitted. Looks the input from forms is not recognized as string. What else and how to overcome this. Any idea?

 

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '1717': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.

v-zhos-msft
Level 10

Re: Convert text from Forms to date before adding a row to Excel

Hi Daniel,

Please pay attation on the Response ID, I was use 2 as a test above. You can take a reference to below:

3.PNG

Regards,

Zhongys

Daniel1973
Level: Powered On

Re: Convert text from Forms to date before adding a row to Excel

Hi Zhongys

I don't know exactly what you mean. Here is the function and a screenshot:

 

plit(body('get_response_details')?['Month'],'.')

 

01-02-_2019_09-45-43.png

 

Daniel

v-zhos-msft
Level 10

Re: Convert text from Forms to date before adding a row to Excel

Hi Daniel,

As you say the options are like: "01.01.2019" "01.02.2019"

The 'Month' in split(body('Get_response_details')?['Month'],'.') is just the name of the Date I setted in the Form.

The action is to split the Date you have selected, like split "01.02.2019" to [01,02,2019]

Best Regards,

Zhongys

Highlighted
Daniel1973
Level: Powered On

Re: Convert text from Forms to date before adding a row to Excel

HI Zhongys

Now it worked! Thanks.

The issue was that I had first to learn how to construct the function. That I simply can select the item.

 

Great support!

 

Daniel

v-zhos-msft
Level 10

Re: Convert text from Forms to date before adding a row to Excel

Hi Daniel,

I was glad to hear that,If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Zhongys

View solution in original post

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,698)