Related

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Russ
    Senior Member
    • Feb 2022
    • 423

    Related

    Hey!
    When I'm trying to send a related record attribute via the "Send HTTP request" on the workflow, it never works
    like this: originalLead.utmcampaign
    screenshot attached, is there any way to make it happen?
    Click image for larger version

Name:	Screenshot 2023-04-14 at 3.56.55 PM.png
Views:	348
Size:	274.3 KB
ID:	90973
    Thanks!
    Attached Files
  • lazovic
    Super Moderator
    • Jan 2022
    • 809

    #2
    Hi Russ,

    Try using a variable in the following format: {$originalLead.utmcampaignId}.

    Comment

    • Russ
      Senior Member
      • Feb 2022
      • 423

      #3
      Originally posted by lazovic
      Hi Russ,

      Try using a variable in the following format: {$originalLead.utmcampaignId}.
      Sorry, I made a wrong screenshot, it was with a variable at the beginning,
      {$originalLead.utmcampaign} but didn't work

      this is how it came in on the other machine:

      {"id":"643873f2c29205e5a","type":"contact","lea dId ":"64386bd691f6f89db","createdAt":"2023-04-13 21:28:18","modifiedAt":"2023-04-13 21:28:48","fbc":"{$originalLead.fbc}","fbp":"{$ori ginalLead.fbp}","ga_pseudo_id":"{$originalLead.gap seudoid}","ipAddress":"{$originalLead.ipaddress}", "utm_campaign":"{$originalLead.utmcampaign}"," utm_ medium":"{$originalLead.utmmedium}","utm_source":" {$originalLead.utmsource}","utm_content":"{$origin alLead.utmcontent}","utm_term":"{$originalLead.utm term}","page-path":"{$originalLead.pagepath}"}

      As you can see above, all related entity variables are not working, but own contact's variables are ok

      Thanks

      Comment

      • Russ
        Senior Member
        • Feb 2022
        • 423

        #4
        So apparently,
        Advanced Pack 2.15.0
        ​must solve the issue:
        Send HTTP Request: Ability to take payload from a formula variable.

        But my case above is still not working

        Comment

        • lazovic
          Super Moderator
          • Jan 2022
          • 809

          #5
          Russ,

          Try to define variables beforehand. Create Execute Formula Script Action and paste the following:
          Code:
          $originalLeadFbc = originalLead.fbc;
          $originalLeadFbp = originalLead.fbp;
          $originalLeadGapseudoid = originalLead.gapseudoid;
          $originalLeadIpaddress = originalLead.ipaddress;
          $originalLeadUtmcampaign = originalLead.utmcampaign;
          $originalLeadUtmmedium = originalLead.utmmedium;
          $originalLeadUtmsource = originalLead.utmsource;
          $originalLeadUtmcontent = originalLead.utmcontent;
          $originalLeadUtmterm = originalLead.utmterm;
          $originalLeadPagepath = originalLead.pagepath;​
          The payload in Send HTTP Request Action, in turn, will look like this:​
          Code:
          {
          "id": "{$id}",  
          "type": "contact",
          "leadId": "{$originalLeadId}",
          "createdAt": "{$createdAt}",
          "modifiedAt": "{$modifiedAt}",
          "fbc": "{$$originalLeadFbc}",
          "fbp": "{$$originalLeadFbp}",
          "ga_pseudo_id": "{$$originalLeadGapseudoid}",
          "ipAddress": "{$$originalLeadIpaddress}",
          "utm_campaign": "{$$originalLeadUtmcampaign}",
          "utm_medium": "{$$originalLeadUtmmedium}",
          "utm_source": "{$$originalLeadUtmsource}",
          "utm_content": "{$$originalLeadUtmcontent}",
          "utm_term": "{$$originalLeadUtmterm}",
          "page-path": "{$$originalLeadPagepath}"
           }
          As for the ability to take payload from a formula variable, it seems to me that it means the full payload. That is, one that we can create, for example, using the json\encode function: https://docs.espocrm.com/administrat...on/#jsonencode.

          As for why related entities data is not pulled into the payload, it seems to me that this is quite logical. I am starting from the article on attributes: https://docs.espocrm.com/administrat...ing/#attribute. There are no fields in the format originalLead.ipaddress (for example). That is, from the related entities in the payload, we can only pull out the id and name.

          But these are just assumptions, I don't use HTTP requests very often in my work and I may not know some details. When I clarify this information with the developers, I will definitely supplement this post with it. In the meantime, I suggest you use the solution I gave you above, with the variables defined in advance.​
          Last edited by lazovic; 04-20-2023, 07:01 AM.

          Comment


          • Russ
            Russ commented
            Editing a comment
            Thank you so much!
        • esforim
          Active Community Member
          • Jan 2020
          • 2204

          #6
          That very interesting we can use Variable and Formula like that.

          Comment

          Working...