Is it possible to directly pass a string parameter value from javascript to a Microflow? If yes, can you please guide. I tried as below but didn't work. The microflow is triggered, but the parameter object keeps being empty, I tried to save and commit as suggested but didn’t worked. can anyone help? Tried Method 1:
Method 1:
function passStringToMicroflow(stringValue) {
mx.data.create({
entity: "Signature.ImageNP",
callback: function (obj) {
obj.set('ImageNPname', stringValue);
object.set('ImageNPname', stringValue);
mx.data.action({
params: {
applyto: "selection",
actionname: "Signature.signMF",
guids: [obj.getGuid()],
},
});
}
obj.save();
mx.data.commit(obj);
});
} Tried Method 2: by this even microflow is not triggered.
Method 2
function passStringToMicroflow(stringValue) {
mx.data.create({
entity: "Signature.ImageNP",
callback: function (object) {
object.set('ImageNPname', stringValue);
mx.processor.xasAction({
error: function () {
logger.error(this.id + "error: error while executing search");
},
actionname: "Signature.signMF",
guids: [object.getGUID()]
});
}
object.save();
mx.data.commit(object);
});
}
Can someone point me in the direction of what is lacking or wrong in the code above? or please suggest any other right way to do. Note: In 'stringValue' i have 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAAgAElEQVR4Xu2dXaytWVpW5.........' data. I need to save in entity so that later i can retrive the image. If any other way please suggest.
↧