Send HTTP Request payload formula function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shef
    Member
    • Jul 2018
    • 38

    Send HTTP Request payload formula function

    I am trying to use a formula function in payload field of the Send HTTP Request action workflow, but it's not working.

    Code:
    {
    "text":"Hello World",
    "fields":[
        {
            "title":"Start",
           "value":"{date\format($dateStart)}"
       },
       {
           "title":"End",
           "value":"{$dateEnd}"
       }
    ]
    }
    I need to use the formula, because otherwise the replaced datetime will be in UTC+0 and it would not be formatted according to settings. Without formatting it would be something like this "2020-07-15 14:50".

    Is it possible to achieve datetime formatting somehow in Send HTTP Request payload?
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi there,
    You can't use Formula in the Payload field. Do you want to send date w/o time part (e.g. w/o 14:50)? As a workaround, you can create a new date type field and push the date from the
    'dateStart' field to it by Workflow or Formula. After, use this field in Payload.

    Comment

    • shef
      Member
      • Jul 2018
      • 38

      #3
      Originally posted by Maximus
      Hi there,
      You can't use Formula in the Payload field. Do you want to send date w/o time part (e.g. w/o 14:50)? As a workaround, you can create a new date type field and push the date from the
      'dateStart' field to it by Workflow or Formula. After, use this field in Payload.
      I thought about using hidden fields, but it feels so "dirty" doing that trick. I was hoping there would be some way to achieve this better.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        BPM allows using variables.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • shef
          Member
          • Jul 2018
          • 38

          #5
          Originally posted by yurikuzn
          BPM allows using variables.
          Is there some guide which shows how to use variables for such purpose? I couldn't find a way on my own to arrange with variables.

          Comment

          • esforim
            Active Community Member
            • Jan 2020
            • 2204

            #6
            Not sure if this help: https://docs.espocrm.com/administration/bpm/

            But some of those hyperlinks lead to a new page rather than section (hard to tell unless you hover over the URL).

            Comment

            • yuri
              Member
              • Mar 2014
              • 8440

              #7
              You can use a variable in a payload definition. The variable should be defined before in a script task (in the same BPM flowchart).

              You can setup your workflow to run a BPM process. That process will be intended solely for HTTP request handling. In that process variables are set in a script task and then are used in the payload definition.
              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

              Comment

              • rodrigocoelho
                Active Community Member
                • Jun 2016
                • 296

                #8
                Originally posted by shef

                Is there some guide which shows how to use variables for such purpose? I couldn't find a way on my own to arrange with variables.
                BPM don't give possibility to use Notes (Stream)...
                Is that possible?

                Thanks

                Comment

                • rodrigocoelho
                  Active Community Member
                  • Jun 2016
                  • 296

                  #9
                  Originally posted by rodrigocoelho

                  BPM don't give possibility to use Notes (Stream)...
                  Is that possible?

                  Thanks
                  yuri , may you confirm if is possible to use Notes on BPM?

                  Thanks

                  Comment


                  • yuri
                    yuri commented
                    Editing a comment
                    It's not possible to use notes as target entity in bpm.

                  • emillod
                    emillod commented
                    Editing a comment
                    You can create note through formula.

                  • rodrigocoelho
                    rodrigocoelho commented
                    Editing a comment
                    I tried, without success. Any example, please? Thanks emillod
                • rodrigocoelho
                  Active Community Member
                  • Jun 2016
                  • 296

                  #10

                  But it is on Workflows. What other way to use Notes? Only via Websockets?

                  Thanks for answering..

                  Comment


                  • yuri
                    yuri commented
                    Editing a comment
                    Please create a separate topics. No need to hijacking a topic.
                Working...