Forum Discussion

wcl3y2's avatar
wcl3y2
New Contributor III
5 years ago
Solved

Snap After Union Executing Before All Inputs Are Received

I have the following flow, and I’m noticing that Exe Contract Amendment is getting executed before the all inputs from Union Original are received. Is that expected? If so, how do I get the Exe Contract Amendment snap to wait for the union?

6 Replies

  • @ykoppisetty

    It is because the parse method expects a number but you are providing a string value.
    You need to parse the “Modified_Date”, you can do so by using parseInt(string).

    In your case would be:

    parseInt($Modified_Date)
    

    And the full expression to format the date would be:

    Date.parse(parseInt($Modified_Date))
    
  • Hi @ykoppisetty

    You can use the Date.parse() function.
    You need to pass the unix timestamp as a parameter.

    Input

    Date.parse(1445910469510)
    

    Output

    2015-10-27T01:47:49.510 Etc/UTC
    

  • ykoppisetty's avatar
    ykoppisetty
    New Contributor II

    Hi @j.angelevski can you tell how to get dynamically?

    For example, the below field contain all the UNIX date formats so how to get normal date formats dynamically?

    Modified_Date
    1445910469510
    1443298668240
    1428458098640

    • shashish_jha's avatar
      shashish_jha
      New Contributor II

      Date.parse($your_input_date).toLocaleDateTimeString({“format”:“yyyy-MM-dd HH:mm:ss”})
      You can change your desired formatting in this section : “format”:“yyyy-MM-dd HH:mm:ss”
      Place this expression into mapper snap and dynamically your_input_date will be picked up and formatted accordingly.

      • ykoppisetty's avatar
        ykoppisetty
        New Contributor II

        Hi @j.angelevski @shashish.jha
        When I am trying through dynamically I am getting the below error.

        Can you please resolve this error. I have also tried the @shashish.jha formula. But that’s also getting error. Please help me on this.

        Thank you.

  • @ykoppisetty

    If that is the field you have in the input document, then you can simply use:

    Date.parse($Modified_Date)