none
Runbook Activity + Format Date/Time Not working + Orchestrator RRS feed

  • Question

  • I am Using Activity Format Date/Time which is not working, probably i am making some mistake. below is the details of the same

    Tuesday, June 18, 2019 2:09 PM

Answers

  • Finally i have found the solution,

    @ runbook, if i use "Format date/time" activity it gives output in date/time as data type

    if i use "Run .NET" Activity we can get output as date/time or in string type. there is option in published data property for same. 

    Now @ SharePoint List i have column as date type. 

    @ Runbook i am using "Get List Item" which has operator "Equals" only which matches my requirement. 

    so output of "Format date/time" & "Run .NET" Activity never matches with equal operator. because at every where there is always difference of seconds and mili seconds. 

    So i have used "Run .NET" Activity instead of "Format date/time" activity. and set output of "Run .NET" Activity as string and also changed SharePoint List column type to Single line of text. 

    now both are string, and with equal operator i am able to compare both strings. hence i am able to exclude part of HH:MM:SS

    • Marked as answer by Mahesh_Gaikwad Wednesday, June 19, 2019 11:46 AM
    Wednesday, June 19, 2019 11:46 AM

All replies

  • Hi,

    in the "Get List Item" Activity use the Relation "Is greater than or equal to" instead of "Equals".

    ADD: and "Format Result" as the Published Data.

    Regards,

    Stefan


    More and news about System Center at stillcool.de and sc-orchestartor.eu .


    • Edited by Stefan HorzMVP, Editor Tuesday, June 18, 2019 2:20 PM ADD: and "Format Result" as the Published Data.
    Tuesday, June 18, 2019 2:19 PM
    Answerer
  • Sorry Stefan I didnt get this 

    ADD: and "Format Result" as the Published Data

    My concern is i am not getting date in "Output Format" getting value MM-dd-yyyy instead of actual date.

    and even if i set "Get List Item" Activity use the Relation "Is greater than or equal to" instead of "Equals". or "Equals"

    still getting below error

    Failed to set input 'Expiry Date'. Reason: String was not recognized as a valid DateTime.

    Exception: ApplicationException
    Target site: StandardRuntimeValue.As

    Stack trace:
       at Microsoft.SystemCenter.Orchestrator.Integration.Framework.Core.StandardRuntimeValue.As(Type type)
       at Microsoft.SystemCenter.Orchestrator.Integration.Framework.Core.StandardRuntimeValue.AsDateTime()
       at SystemCenter.IntegrationPack.SharePoint.Extensions.RuntimeValueExtensions.ToQueryValue(IRuntimeValue value, FieldType fieldType)
       at SystemCenter.IntegrationPack.SharePoint.Domain.Comparison.GetValueElement(SharePointField field)
       at SystemCenter.IntegrationPack.SharePoint.Domain.Comparison.GetWhereClause(SharePointField field)
       at SystemCenter.IntegrationPack.SharePoint.Domain.Comparison.GetWhereClause(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.GetWhereElement(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.GetQueryElement(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.GetViewXml(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.Execute()
       at SystemCenter.IntegrationPack.SharePoint.Activities.GetListItemsActivity.Execute(IExecuteContext context)
       at SystemCenter.IntegrationPack.SharePoint.Activities.SharePointActivityBase.Execute(IActivityRequest request, IActivityResponse response)


    Tuesday, June 18, 2019 2:42 PM
  • Hi,

    you have subscribed "Output format from "Format Date/Time"". This not a valid date.

    You must subscribe "Format Result from "Format Date/Time".

    Regards,

    Stefan


    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Tuesday, June 18, 2019 3:02 PM
    Answerer
  • I got the value for "Format Result from "Format Date/Time"

    but further in Get List Item filer i am getting below error 

    Failed to set input 'Expiry Date'. Reason: String was not recognized as a valid DateTime.

    Exception: ApplicationException
    Target site: StandardRuntimeValue.As

    Stack trace:
       at Microsoft.SystemCenter.Orchestrator.Integration.Framework.Core.StandardRuntimeValue.As(Type type)
       at Microsoft.SystemCenter.Orchestrator.Integration.Framework.Core.StandardRuntimeValue.AsDateTime()
       at SystemCenter.IntegrationPack.SharePoint.Extensions.RuntimeValueExtensions.ToQueryValue(IRuntimeValue value, FieldType fieldType)
       at SystemCenter.IntegrationPack.SharePoint.Domain.Comparison.GetValueElement(SharePointField field)
       at SystemCenter.IntegrationPack.SharePoint.Domain.Comparison.GetWhereClause(SharePointField field)
       at SystemCenter.IntegrationPack.SharePoint.Domain.Comparison.GetWhereClause(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.GetWhereElement(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.GetQueryElement(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.GetViewXml(SharePointFieldMap fieldMap)
       at SystemCenter.IntegrationPack.SharePoint.Domain.GetListItemsHelper.Execute()
       at SystemCenter.IntegrationPack.SharePoint.Activities.GetListItemsActivity.Execute(IExecuteContext context)
       at SystemCenter.IntegrationPack.SharePoint.Activities.SharePointActivityBase.Execute(IActivityRequest request, IActivityResponse response)

    Tuesday, June 18, 2019 3:31 PM
  • in Above case i have used below format

    MM/DD/YYYY

    hence it would be giving error 

    if i change format to 

    yyyy-MM-ddT00:00:00

    then its not giving error but its not even able to compare list column value 

    if i set Greater than equal to then it takes all further dates which i dont wont. 

    Tuesday, June 18, 2019 3:52 PM
  • Sorry, in this case "less or equal".

    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Tuesday, June 18, 2019 8:03 PM
    Answerer
  • No, it will take all the dates below that value, 

    we want only item with todays date as Expiry date.

    Wednesday, June 19, 2019 7:32 AM
  • Finally i have found the solution,

    @ runbook, if i use "Format date/time" activity it gives output in date/time as data type

    if i use "Run .NET" Activity we can get output as date/time or in string type. there is option in published data property for same. 

    Now @ SharePoint List i have column as date type. 

    @ Runbook i am using "Get List Item" which has operator "Equals" only which matches my requirement. 

    so output of "Format date/time" & "Run .NET" Activity never matches with equal operator. because at every where there is always difference of seconds and mili seconds. 

    So i have used "Run .NET" Activity instead of "Format date/time" activity. and set output of "Run .NET" Activity as string and also changed SharePoint List column type to Single line of text. 

    now both are string, and with equal operator i am able to compare both strings. hence i am able to exclude part of HH:MM:SS

    • Marked as answer by Mahesh_Gaikwad Wednesday, June 19, 2019 11:46 AM
    Wednesday, June 19, 2019 11:46 AM
  • Hello, I am extracting data from sharepoint list to SQL server using Orchestrator Runbook Designer . I am facing a similar issue when using modified field from sharepoint when trying to compare the date field from SQL server .  @Mahesh_Gaikwad could you please share how were you able to implement this using Run .NET

    

    • Edited by Vish G Thursday, August 8, 2019 8:28 PM Example
    Thursday, August 8, 2019 8:28 PM