Set inputs to common module

Hi All,

I m facing challenge to set inputs into common module.

I m using below code but inputs are empty in architect.

await scriptingFlowFactory.getFlowInfoByFlowNameAsync(flowName, scriptingEnums.FLOW_TYPES.commonModule,
function (commonModuleInfo) {

                        var retCommonModule = callCommonModule.setCommonModuleFlowByIdAsync(commonModuleInfo.id);                    
                          callCommonModule.inputs[0].setExpression("\"" + smsMsg +"\"");
                          callCommonModule.inputs[1].setExpression("\"" + smsMsgId +"\"");  

                        });

                    }

Regards,

Benjamin

Hi Benjamin_Guenard,

Thanks for reaching out. ArchActionCallCommonModule.inputs returns an ArchNamedValueList. To set an expression on an input by index, you will want to do callCommonModule.inputs.getNamedValueByIndex(0).value.setExpression("\"" + smsMsg +"\"").

Additionally, from the documentation from the inputs property on the Call Common Module action: The contents of this named value list come from the flow inputs defined on the common module flow configured on this action. Remember that the flow input names in the named value list will match up with variables defined as inputs on the common module flow. So you will want to make sure that the common module flow you are using has those variables defined as inputs.

Also, setCommonModuleFlowByIdAsync is an async function so you will either want to await on that function call or use a callback function as the 3rd parameter as defined in the documentation for this function.

Thanks,
Jon

Hi John,

Thanks for your quick answer, it works as expected !

kind regards,

Benjamin

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.