I am trying to create a flow (first time) that transfers data from a SharePoint Online list to a SQL table.
There are 2 issues I am dealing with which is that I can't map Created and Modified fields from SharePoint to the respective fields in SQL which are both datetime types.
When I click into other SQL text (varchar) fields to pick the SharePoint field then I see Created and Modified. However when I go to Created or Modified then those 2 no longer show up as available fields? Why? Are they not 'datetime' format so they disappear because they don't match the SQL field datatype? How do I map those fields?
Also, how do I insert the current date time value into my Last_Import_Date field in SQL? If I was running that import in SQL then I would insert GETDATE()
(I want date/time value in my timezone)
Everything else works fine
Please take a try with expression below:
convertToUtc(items('Apply_to_each')?['Created'], 'GMT Standard Time')
Hi - your suggested expression resulted in an error but it was helpful either way because it led me to this:
formatDateTime(items('Apply_to_each')?['Created'],'yyyy-MM-ddTHH:mm:ss')
formatDateTime(items('Apply_to_each')?['Modified'],'yyyy-MM-ddTHH:mm:ss')
I didn't even know how to get the Created and Modified fields out of the 'Apply to Each' loop container into the expression and your answer helped with that. Here is the error that your expression resulted in:
InvalidTemplate. Unable to process template language expressions in action 'Insert_row_(V2)' inputs at line '0' and column '0': '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 '2021-01-05T19:58:25.0000000Z'. Please see https://aka.ms/logicexpressions#ConvertToUtc for usage details.'.
User | Count |
---|---|
92 | |
40 | |
23 | |
20 | |
16 |
User | Count |
---|---|
130 | |
49 | |
46 | |
28 | |
25 |