Hi,
I am trying to get the document name by passing the documentId. If I am fetching the documentid into a local variable and pass, then I am getting an error. Where as when I pass the documentId number manually, I am getting required output.
Not sure what is wrong. Do I need to do any kind of conversion before assign to a local variable.
a!localVariables( local!templateDetails: rule!LC_getTemp(Key: 4), local!documentId: index(local!templateDetails, "documentid",null()), local!documentId /*document(local!documentId,"name")*/)
When I try to execute below code, I am getting below output.
a!localVariables( local!templateDetails: rule!LC_getTemp(Key: 4), local!documentId: index(local!templateDetails, "documentid",null()), document(local!documentId,"name"))
Whereas when I try to execute the above code, I am getting the below error. Can someone advice here.
Discussion posts and replies are publicly visible
please convert document id from list of variant to tointeger.
it is casting error. cast your documentId to integer.
a!localVariables( local!templateDetails: rule!LC_getTemp(Key: 4), local!documentId: tointeger(nindex(local!templateDetails, "documentid",null())), document(local!documentId, "name", "") )
Even if I convert to integer, I am getting an error
Use the following logic.
a!localVariables( local!templateDetails: rule!LC_getTemp(Key: 4), local!documentId: cast(1,index(local!templateDetails, "documentid",null())), document(local!documentId, "name", "") )
Great help. Thank you so much Naresh.