Architect Scripting SDK Collect input

Hi Team,
Trying to use below method for collecting user input. i want to pass javascript variable to pass as input variable in method and collect user input. Can you help me with simple code example for javascript.
addActionCollectInput(archMultiActionContainer, name, inputAudioTTS, inputVariable, interDigitTimeoutMS, noEntryTimeoutMS, previousArchAction);

Hi

You can find specific use cases for each API and how to make calls to the respective API https://developer.genesys.cloud/devapps/api-explorer
Did you try searching for the specific API use case here ?

i'm really not sure which API need to use. We have bundle of javascript classes and variables. do we have any function or variable help me to get runtime input data.

Hi,

Would you be able to provide some more details, what is the context of what you are trying to do? If you could provide your code also it might help us understand and point you in the right direction.

Regards,
Declan

function(archInboundCallFlow) {

	archInboundCallFlow.initialAudio.setDefaultCaseExpression('ToAudioTTS("welcome to the flow")');	
	
    archInboundCallFlow.settingsSpeechRec.asrCompanyDir = scriptingEnums.SPEECH_REC_COMPANY_MODES.none;
    archInboundCallFlow.settingsSpeechRec.asrEnabledOnFlow = false;				
    const startupTask = scriptingTaskFactory.addTask(archInboundCallFlow, 'startup task', true);
	var EmpID=[];
	const input =scriptingActionFactory.addActionCollectInput(startupTask,EmpID,'Please enter your Employee ID',8000,8000);

I want to pass "EmpID" variable as input parameter for function "scriptingActionFactory.addActionCollectInput".

scriptingActionFactory.addActionCollectInput(startupTask,'AskEmpID',EmpID,'Please enter your Employee ID',8000,8000);
Previous action element is optional. Hence nothing is added. I want to pass "EmpID" variable as input parameter for function "scriptingActionFactory.addActionCollectInput".

I am waiting for your update

Hi

For the addActionCollectInput function
(function(archMultiActionContainer, name, inputAudioTTS, inputVariable, interDigitTimeoutMS, noEntryTimeoutMS, previousArchAction))

the EmpId variable you want to pass I assume is the name of the ActionCollectInput. You can convert it to a string and pass it onto the function and it should be able to accept.

i want to collect Caller input into javascript variable. is there any way ?

I am not sure how you are trying to access this. But there are straight data actions available for collect input which you can leverage to add to your flow

Hi @Basanagouda.goudar,

Here is the link to the documentation for the addActionCollectInput - Class: ArchFactoryActions | Architect Scripting

As you can see in the documentation for this function and like @Hemanth posted the parameters for this function are:

For the inputVariable parameter, when it says the variable to use to hold the input data this is actually an Architect variable (i.e. Task.my_variable_name) and not a JavaScript variable. So for example when adding this action it would be something like
scriptingActionFactory.addActionCollectInput(startupTask, 'AskEmpID', 'Please enter your Employee ID', 'Task.EmpId', 8000, 8000);

Where the Task.EmpId is the Architect variable for the inputVariable parameter. You can also use the addVariable function on an ArchTask to add a new variable to your flow first and then pass in that instead of just the name.

I hope this helps.

Thanks,
Jon

Thanks for the reply.
Is it possible to assign directly customer given input into javascript variable ?

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