Hi all,
My older version code uses executesqlQuery to execute a SQL code and it returns dictionary value . They used the rule in main interface to save the values to local variables. Now the function is deprecated and we replace it with executeStoredProcedureForQuery to execute SQL and it returns Map structure. But we are getting error while saving that in the main interface.
This is the error we are getting. I have changed the index value as the new structure but still I am getting error. Anyone have idea about how to resolve that?
Thanks,
Kavya
Discussion posts and replies are publicly visible
Can you try to use proper keyword syntax like below.
a!save( target: local!something, value: rule!something() )
Oh dear .... It's a while ago I saw > 500 lines of code in a saveInto.
The lines 344 and 464 and look suspicious. You cannot store data to a local that way. Use an a!save().
BTW, do you really need to dynamically construct SQL statements in Appian and send them to a stored procedure for execution?
there you have a!saves() and local variable declaration in a saveinto?
any deeper sense, which I might miss for this kind of {}-structure in the saving logic?
small hint:you dont need the if at line 530. just rule!apn_isblank is enough.in line 522 you don't need the and()
Agreed with this - local!sqlData and local!sqlResult are being invoked in an unsupported way and i'd be surprised if it even worked by accident. I believe the error in the screenshot is likely directly related to these two lines, since they are not a valid save operation.
Unknown said:there you have a!saves() and local variable declaration in a saveinto?
Yes, this will cause the issue. The local variable declarations in saveInto should also be wrapped in a!save() instead, such as here:
And here:
You can replicate this error by trying this in a simple interface:
a!localVariables( local!buttonVal, a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Save", saveInto: { a!save(local!buttonVal,"test"), local!test: a!map(id: 1) /* This line is not correct! */ } ) } ) )
To add to the thread this error also will occur for the situation where you have a rule input defined as an expression, not a variable. Such as an a!save(ri!value,"test"), where the input definition in the user input task is something like a string "value here", vs a variable such as pv!value.
this looks familiar, lol...
Mike Schmitt said:this looks familiar, lol...
Ha, oops! But I agree!
Sometimes ri!name << fn!sum error occurs when the evaluation of an if condition returns array of true or false instead of single value in the saveInto parameter.