web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Pass Current record GUID for JSON Schema in flow

(0) ShareShare
ReportReport
Posted on by 595

Hi, i'm using custom ribbon button to call flow which is HTTP request trigger.. in the form.. now i wan't to pass Current record's GUID to JSON schema for further use... Please help..

I have the same question (0)
  • Suggested answer
    ACECORP Profile Picture
    1,589 on at

    The Record ID that is returned in the Body of the HTTP Request should be the GUID.

    If you add a Parse JSON Action Card and read in the Body of the HTTP Request to that Parse JSON Object, one of the values inside that Parse JSON result will be the ID field, which contains the GUID.

    You can then reference ID from the Parse JSON Object and put that into a String Variable for reference anywhere in the Flow.

    See https://powerusers.microsoft.com/t5/Building-Flows/JSON-Parse-Output-How-to-access-properites-from-Child-Object/td-p/189142 on how to access the properties that are returned in the Parse JSON Object, such as the GUID.

    See https://d365demystified.com/2020/04/12/using-parse-json-to-read-individual-list-records-in-flowpower-automate/ for some basic info that shows how to iterate through results and some related info.

  • Suggested answer
    Susana Carneiro Profile Picture
    on at

    Hello Abhilash,

    To pass current record's GUID to JSON schema for further use you can use the below sample code on your custom button:

    function sendFlowRequest(formContext)
    {  
    var CJGuid = formContext.data.entity.getId();
    CJGuid = CJGuid.replace(/[{}]/g,"");
    parent.$.ajax({
           type: "POST",
           url: "**FLOW URL HERE**",
           contentType: 'application/json',
           data: JSON.stringify({"CJGuid" : CJGuid}),
    success: function ()
    {
               alert("success");

    }
    });
    }

    This will return the record ID from the context and it can used later:

    pastedimage1594051581178v1.png

    Please refer to Calling Flow from Custom Button in DYnamics.

    To generate the Request Body JSON Schema you can initially run the Flow with this empty and later using the Response body you can use "Use sample payload to generate schema".

    The response will be like:
    {
      "CJGuid""RecordId"
    }

    Once we pasted this to generate the schema the below will be generated:
    {
        "type""object",
        "properties": {
            "CJGuid": {
                "type""string"
            }
        }
    }
    On your custom button you also need to pass a CRM parameter to be able to get the formContext, see the example:
    pastedimage1594052285037v2.png

    Hope this helps.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    You can use pre-built smart buttons developer by scott to call flow and pass record ID.

    see below step by step article on how to achieve that.

    xrmdynamicscrm.wordpress.com/.../

    If found helpful, Please mark my answer verified.

  • roh Profile Picture
    25 on at

    how to pass list of guids there

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 47

#2
Martin Dráb Profile Picture

Martin Dráb 41 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 32 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans