Date Formatter in JSON

Overview

Contains a function that can be used when sending data in JSON format e.g. storing or updating data in a database using Web API to convert date formats.  This listing contains the modifyjsondata() function and instructions on how to use the function. Works with any format of Date / Date Time conversion, given that the provided date / date time format as an input to this plug-in is correct as per the JSON. It can also modify list of Date attributes of the JSONObject / JSONArray at a time (e.g. createdOn (Date), modifiedOn (Date)), instead of doing it one after the another.

NOTES:

  • Please avoid the usage of an explicit dictionary key while passing a JSON String to this plug-in. Example:
    • {"EmployeeDetails": [{"id": "1", "name": "Demo"}, {"id": "2", "name": "Demo1"}]} , Here "EmployeeDetails" is the explicit dictionary Key,
    • Instead please pass it as below: [{"id": "1", "dob": "01-02-2019"}, {"id": "2", "dob": "15-07-2019"}] -- Here this JsonArray is converted using the existing CDT Array i.e. toJson(YOUR_CDT/YOUR_CDT_ARRAY)
  • Please avoid the usage of this plug-in, if you want to modify a Date / Date Time property of a Child CDT (Nested) through the parent. Example:
    • EmployeeDetails.PersonalDetails.DOB, Here EmployeeDetails is the parent and PersonalDetails is the child (Nested CDT) But if your date property, the part of your parent CDT i.e. EmployeeDetails.DOB then you can use this plug-in to perform the conversion.
Anonymous
Parents
  • Hi Alok - i've discovered a bug in this plug-in.  When a JSON string has its date updated and the date happens to be the last field in the CDT / Dictionary, the returned JSON string accidentally omits the final "]" and "}" characters.  It seems to only happen when the updated property is the last one in the cdt/dictionary, i.e. in my tests if I add an extra field after, the problem disappears.

    For example here's a test dictionary with date fields for "created" and "modified".  When i just update "created", the output is correct as I expect:

    However when i update "modified", since it's the last field, it omits the last 2 closing characters:

    This is causing us some pretty weird and severe issues in our project where we're using this plug-in, as certain things are randomly failing when the JSON text is re-loaded.

  • Hi Mike, Apologies for the delay in my response, as I was on a vacation, and apologies for the problem caused in your project due to this plug-in. Also thanks for your input. I will try to upload a new version of this plug-in shortly (probably by this weekend). Once again thanks for identifying this issue.  Thanks!

  • Hi Alok,

    Since you've changed companies and have a new account (aloks0001 vs aloks176) you were unable to submit a new version of this plug-in. I've updated the security on the plug-in so that you submit a new version. Thanks for your contribution!

  • Hi Mike, 

    I am trying to upload a new version of this plugin, but unfortunately I am unable to find any site link to upload a new version of this plugin. Looks like Appian has changes the url's to upload / update a shared component. I had a look on 

    https://forum.appian.com/suite/sites/shared-components as well as 

    https://forum.appian.com/suite/sites/appmarket-submissions/page/tasks URL and their respective links / navigations but couldn't find any option to drill down / select an existing plugin and upload new version. 

    I could see an option to upload a new App at: https://forum.appian.com/suite/sites/appmarket-submissions/page/home URL but no option to upload a new version of an existing plugin.

    Could you please help me with the approach / link, if you are across this.  

    Thanks!

Comment Children