Custom widget data to Microflow - Error - Invalid JSONRequest: JSONObject[actionname] not a string

Hi Can someone help? This is a simple test widget to send the ID to Mendix microflow. It is giving an error Error - Invalid JSONRequest: JSONObject["actionname"] not a string Execute microflow call event handler this.connect(this.saveHotspotNode, "click", function (e) { // Only on mobile stop event bubbling! this._stopBubblingEventOnMobile(e); // If a microflow has been set execute the microflow on a click. if (this.mfToExecute !== "") { this._execMf(this.mfToExecute, this._contextObj.getGuid()); //this._execMf(this.mfToExecute, this._contextObj.jsonData.attributes.HotspotResult.value); } }); Execute function _execMf: function (mf, guid, cb) { logger.debug( + "._execMf"); var _params = { actionname: mf, applyto: "selection", guids: [guid] }; var mfAction = { params: _params, callback: lang.hitch(this, function (objs) { if (cb && typeof cb === "function") { cb(objs); } }), error: function (error) { console.debug(error.description); } }; if (mf && guid) { mx.ui.action(mfAction, this); } },   Full error org.json.JSONException: JSONObject["actionname"] not a string. at org.json.JSONObject.getString( at com.mendix.webui.actions.client.ExecuteAction.execute( at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:311) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:143) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf( at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:145) at scala.util.Try$.apply(Try.scala:192) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:139) at$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:135) at at at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec( at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask( at scala.concurrent.forkjoin.ForkJoinPool.runWorker( at My widget Domain Model: Microflow: Questions: 1. What's wrong with the code to fix error 'Invalid JSONRequest: JSONObject["actionname"] not a string' '[SOLVED]' // Thanks to Chris: SOLUTION -  replace 'mx.ui.action' with '' 2. Can I also ask that i have an array list which i want to send back to microflow as string. what is the best way to get string and send it back. Is there any string length limit? I am thinking to use dojo/json.stringify() function to get string.   'SOLVED' //Had to use .set function to update the context object and it updates the object to pass Microflow this._contextObj.set("HotspotResult", JSON.stringify(this._hotspotArray));   Thanks for the help in advance    
1 answers

Use in stead of mx.ui.action

Jsonify the string is fine, length is at least 32k