Hi All for the attached code it is showing the error attached. The attached code will saved into "Country " variable Of type textCould you please help me
rule!ISR_er_displayCountryNameById( countryId: index( rule!ISR_qry_GetAddressInfo( type: cons!ISR_REF_CODE_ADDRESS_TYPE_PRIMARY_RESEARCHER, typeId: index( rule!ISR_qry_GetPersonDetailsbyStudyRequestId( studyRequestId: pv!studyRequest.studyRequestId, ).data, "studyPnId", null ) ).data, "countryId", {} ) )
Discussion posts and replies are publicly visible
This is the error for above code
One of the queries is returning a null and .data is not resolving to anything.
You can either fix the queries to force it to return a datasubset (even if empty) or you can check for nulls in this expression and adjust behaviour accordingly.
That being said, nesting queries like this is not a best practice. With Record Types (with the appropriate relations), this type of query would be much cleaner.
The error itself is very clear. When you have already used index() function, why not put the data in it too?