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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Unanswered

Running Power Automate flow via button using Ribbon Workbench

(0) ShareShare
ReportReport
Posted on by 8

I have a flow that runs via a HTTP request: 
pastedimage1625839041645v1.png

My button is set on a custom  entity "Return"

javascript used to call the flow:

function callFlow(primaryControl) {
	var formContext = primaryControl;
	var returnGUID = formContext.data.entity.getId();
	var returnGUID = returnGUID.replace('{', '').replace('}', '');

	if (typeof($) === 'undefined') {
		$ = parent.$;
		jQuery = parent.jQuery;
	}

	var settings = {
		"async": true,
		"crossDomain": true,
		"url": "REDACTED LINK",
		"method": "POST",
		"headers": {
			"Content-Type": "application/json",
			"cache-control": "no-cache",
			"Postman-Token": "217c65f0-99d5-4283-8361-6a9e639c9a0b"
		},
		"processData": false,
		"data": "{\n	\"returnid\": \"("   returnGUID   ")\"\n}",
		"beforeSend": function() {
			Xrm.Utility.showProgressIndicator("Return is being submitted.");
		},
        "complete": function() {                    
        }
	}

	$.ajax(settings).done(function(response) {
		console.log(response);
		if (response.StatusCode == "SUC-999") {
                Xrm.Utility.closeProgressIndicator();
		} else {
               var alertStrings = {
				confirmButtonLabel: "OK",
				text: "Error code:  "   response.StatusCode   "\n"   "Error description:  "   response.StatusDescription,
				title: "There has been an error!"
			};
			var alertOptions = {
				height: 100,
				width: 200
			};

			Xrm.Navigation.openAlertDialog(alertStrings, alertOptions);
			Xrm.Utility.closeProgressIndicator();
		}
	formContext.data.refresh();
	});
}

When i click the button, i check the flow and its failing

Get a 404 error:




404 - File or directory not found.




404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

The flow does receive the GUID of the record

pastedimage1625839201227v2.png

Im thinking it might be the brackets surrounding the GUID but im unsure how to remove them

  • G.Vetere Profile Picture
    8 on at

    Answer:

    JSON needed updating:

    "data": "{\"returnid\" :\ " " returnGUID " \ "}",

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Syed Aqib Raza Profile Picture

Syed Aqib Raza 42

#2
11manish Profile Picture

11manish 19 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 19

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans