none
convert date to String format :Scripting functoid BizTalk RRS feed

  • Question

  • Hi, I have input element as datatype as Date... my output element is string.

    How can I convert date to string format ?

    My input data is :  2017-02-03

    Thursday, February 16, 2017 1:27 AM

Answers

  • Hi ,

    Is there any problem you are facing while doing a direct mapping ? 

    I think you can map as it is or you can try to use a script functiod to pass the date and return string "+date+"


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    • Marked as answer by Reason101 Thursday, February 16, 2017 8:34 PM
    Thursday, February 16, 2017 1:50 AM

All replies

  • Hi ,

    Is there any problem you are facing while doing a direct mapping ? 

    I think you can map as it is or you can try to use a script functiod to pass the date and return string "+date+"


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    • Marked as answer by Reason101 Thursday, February 16, 2017 8:34 PM
    Thursday, February 16, 2017 1:50 AM
  • Hi ,

    Take the Xpath of the date node within and use it within your xslt .Something like below 

    <xsl:value-of select="Person/dateofbirth/text()" />
    or you can create a function within the xslt to get the date and return string "+date+"


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    Thursday, February 16, 2017 2:07 AM
  • I am receiving error as if I map directly from element of datatype 'date' to element of datatype 'string'

     Exception Caught: The map contains a reference to a schema node that is not valid.  Perhaps the schema has changed.  Try reloading the map in the BizTalk Mapper.

    I tried changing complete schema, reloaded rebuild Map everything is fine but if I am mapping this date element to string element its throwing me error.

    Is there a fix for this by direct mapping ?

    Thursday, February 16, 2017 2:14 AM
  • Hi ,

    Have you tried debugging the XSLT .

    You can easily do this using Visual Studio. Give bit of your time as these are all learning curves :)


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    Thursday, February 16, 2017 3:00 AM
  •  Exception Caught: The map contains a reference to a schema node that is not valid.  Perhaps the schema has changed.  Try reloading the map in the BizTalk Mapper.

    So, this has nothing to do with the type of either node.  More likely, something is cached somewhere.

    Do a Clean, then rebuild.

    Thursday, February 16, 2017 3:29 AM
    Moderator
  • The solution to solve this issue is simple, you just need to rebuild the entire solution or rebuild the schema project before you try to validate or test the maps.

    After the Schema project solution is rebuild the problem will disappear and you will be able to validate or test the map.

    Rachit Sikroria (Microsoft Azure MVP)

    • Proposed as answer by Chandra Kumar Thursday, February 16, 2017 1:47 PM
    Thursday, February 16, 2017 4:14 AM
    Moderator