cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Help writing SharePoint Created date to SQL table

I need some assistance with a flow I'm creating. The flow is supposed to take the items in a SharePoint list on a given frequency, write them to our SQL DB, then delete the SP records.

 

My flow is failing when trying to write the SP Created date to the Created (datetime DataType) field in my SQL table. I've tried modifying a solution I found to a different problem here but am still having issues.

I tried the below code but got the error in the screenshots.

 

convertToUtc(outputs('Get_items')?['Created'], 'GMT Standard Time')

flow1.pngflow2.png

 

7 REPLIES 7
Highlighted
Helper V
Helper V

I've tried the following code but am still receiving errors.

1. convertToUtc(outputs('Get_items')?['body/Created'], 'GMT Standard Time')
2. convertToUtc(outputs('Get_items')?['value/Created'], 'GMT Standard Time')
3. convertToUtc('Get_items'()?['Created'], 'GMT Standard Time')

Error: One or more fields provided is of type 'Null', a different type is expected.

 

Highlighted
Community Support
Community Support

Hi @kriggo15 ,

 

Please take a try with expression below:

convertToUtc(items('Apply_to_each')?['Created'], 'GMT Standard Time')

 

Best Regards,

Alice

 

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

Highlighted

@v-alzhan-msft, unfortunately that resulted in an error seen below.

InvalidTemplate. Unable to process template language expressions in action 'Insert_row_(V2)' inputs at line '1' and column '22920': 'The template language function 'convertToUtc' expects its second parameter to be a time zone matching the time zone indicated by the timestamp. The provided value '(UTC+00:00) Dublin, Edinburgh, Lisbon, London' is not valid or does not match the timestamp '2020-09-22T12:07:09.0000000Z'. Please see https://aka.ms/logicexpressions#ConvertToUtc for usage details.'.

Highlighted

Hi @kriggo15 ,

 

Please share the configuration of the flow and the expression that you use.

 

Best Regards,

Alice

 

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

Highlighted

Hi @kriggo15 ,

 

Does your issue still exists?

 

Best regards,

Alice       

 

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

Highlighted

While probably not the best way to solve the problem, I did find a workaround:

formatDateTime(items('Apply_to_each')?['Created'],'yyyy-MM-ddThh:mm:ssZ')
Highlighted
Frequent Visitor

Hi @kriggo15 ,

 

An option would be to apply this solution from another post I've found here - which uses the "Convert time zone Action" 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (8,976)