Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Setting Action Output Parameter using WebHooks

Posted on by 5

Hi everyone,

I created an Azure Function that is called from CRM via WebHook. It is linked with an action in CRM. Calling the action new_WoPaTest triggers the execution of the Function. 

pastedimage1595925995248v1.png

Fair enough, input parameters of the action are passed on to the Function. However, I do not know how to transfer the output parameters from the Function to the action.

pastedimage1595927809057v2.png

Does anyone know the correct way to create the response of the Function? I've already tried some different approaches, but none has worked for me so far.

Thank you!

  • Patrick Profile Picture
    Patrick 5 on at
    RE: Setting Action Output Parameter using WebHooks

    Thanks for your answer. But is there a way to inject output parameters directly, without the need for creating a separate plugin?

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Setting Action Output Parameter using WebHooks

    Hi,

    See below article to call azure function from plugin using 3 different ways.

    xrmdynamicscrm.wordpress.com/.../

    When we use HttpClient to invoke azure function, we can get the response from azure function as httpresponse.

    Sample code below to get response from httpclient call.

    HttpResponseMessage whoAmIResponse =

               await httpClient.GetAsync("AZURE FUNCTION URL");

           Guid userId;

           if (whoAmIResponse.IsSuccessStatusCode)

           {

               JObject jWhoAmIResponse =

                   JObject.Parse(whoAmIResponse.Content.ReadAsStringAsync().Result);

               userId = (Guid)jWhoAmIResponse["UserId"];

    }

    If found helpful, Please mark my answer verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans