cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
yoshihirok Memorable Member
Memorable Member

Tips: convert from Twitter's "Created At" string format to SQL Server DateTime compatible format.

I want to share my tips about Twitter's "Created At".

For inserting "Created At" to SQL Server DateTime type column. 

 

Tips:

  Convert from Twitter's "Created At" String format to SQL Server datetime compatible format.

 

Example:

  Twitter's "Created At" string: Sat Dec 03 10:02:13 +0000 2016

  SQL Server datetime compatible format: 2016/Dec/03 10:02:13

 

Flow:

1. Trigger - When a new tweet is posted.

2. Action - Compose

  Name : CreatedAt

  Inputs : Twitter's "Create at" value

3. Action - Compose

  Name : CreatedAtArray

  Inputs : "@split(outputs('CreatedAt'), ' ')"

4. Action - Compose

  Name : CreatedAtDatetime

  Inputs: "@concat(outputs('CreatedAtArray')[5], '/', outputs('CreatedAtArray')[1],'/',outputs('CreatedAtArray')[2],' ',outputs('CreatedAtArray')[3])"

 

Now, CreatedAtDatetime's output can insert SQL Server's DateTime column by "SQL Server - Insert row" action.

Attention: the Double quote need Inputs for Step 3, Step 4.

and Function of Step 3, Step4 is Workflow Definition Language.

 

Regards,

Yoshihiro Kawabata

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Tips: convert from Twitter's "Created At" string format to SQL Server DateTime compati

 

Hi yoshihirok,

 

Thanks for your sharing. Works great. 🙂

 

In addition, there is a datetime format function available, which would format the date string of step 4 into ISO 8601 format by default:

formatDateTime Returns a string in date format. The result is a string in ISO 8601 format ("o") by default, unless a format specifier is provided.

 

We could use the following method to format the date:

"@formatDateTime(concat(outputs('CreatedAtArray')[5],'/',outputs('CreatedAtArray')[1],'/',outputs('CreatedAtArray')[2],' ',outputs('CreatedAtArray')[3]),'yyyy-MM-dd hh:mm:ss')"

You could find the other function reference below:

Workflow Definition Language

 

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Tips: convert from Twitter's "Created At" string format to SQL Server DateTime compati

 

Hi yoshihirok,

 

Thanks for your sharing. Works great. 🙂

 

In addition, there is a datetime format function available, which would format the date string of step 4 into ISO 8601 format by default:

formatDateTime Returns a string in date format. The result is a string in ISO 8601 format ("o") by default, unless a format specifier is provided.

 

We could use the following method to format the date:

"@formatDateTime(concat(outputs('CreatedAtArray')[5],'/',outputs('CreatedAtArray')[1],'/',outputs('CreatedAtArray')[2],' ',outputs('CreatedAtArray')[3]),'yyyy-MM-dd hh:mm:ss')"

You could find the other function reference below:

Workflow Definition Language

 

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

yoshihirok Memorable Member
Memorable Member

Re: Tips: convert from Twitter's "Created At" string format to SQL Server DateTime compati

Hi, @v-micsh-msft

 

Thank you, formatDateTime() information.

 

and I hope to formatDateTime() supporting Twitter's Created At string as parameter.

 

Regards,

Yoshihiro Kawabata

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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

Users online (7,698)