215291 - no subject - Hi All, I am in version 7.4, I am using

Hi All, I am in version 7.4, I am using the getPortalReportDatasubset function when I am trying to read a Task Report, and Getting the First Task ID by using data[15].cells.value[1]. I am using this on click of a button to get the Task ID, to be saved into the local! variable in a SAIL code, this works perfectly fine,But when I try to execute the output in the Expression rule this is giving me an Empty result, Is there a problem with this function , or I am missing something, Could someone guide me.

TIA

OriginalPostID-215291

  Discussion posts and replies are publicly visible

Parents
  • @harshav So as far as my observations are considered, the report you are making use of belong to a category where the User object acts as a context and I came to this conclusion as you aren't making use of the 'contextIds' argument. If we carefully observe the code snippet(specified by you in the previous comments), only two arguments namely reportId and pagingInfo are being used and I believe these wouldn't cause a problem definitely as these are pretty straight forward and simple configurations. I am assuming that the Document (Portal Report) object is accessible to all the users under whom the query needs to be made.

    So the issue could be with the context which is substituted with logged in user during the execution of the function. There shouldn't be any problem with the context as long as you execute the expression from the Designer Interface (Context is Logged In User) or SAIL interface (Context is Logged In User or Task Owner) as the context is quite clear. To the best of my knowledge, the expression behaves differently only when it's used else where because the context varies based on the place in which the expression is being utilised. Documentation at https://forum.appian.com/suite/help/16.2/User_Contexts_for_Expressions.html speaks re how the context varies in various places.

    So let's take the code snippet of yours as an example. Assume that you have assigned a task to me in which the code snippet will be executed upon interaction with a SAIL component. Then the code snippet will be executed with @sikhivahans as context. If you execute the same code snippet in the designer portal, it will be executed with @harshav as the context. Now let's say the same code snippet is included in the script task in the process model that is designed by a user namely john.doe and let's say the node is configured to run as designer. In this case, the code snippet will be executed with @john.doe as context. In case, if the node is configured to run as initiator, the same code snippet will be executed with pp!initiator as context. In all these cases, there is a chance for significant variance in the results as the context is varying.

    I have used the Portal to SAIL plugin extensively and as far as my experience is considered, there isn't any problem(except Performance).
Reply
  • @harshav So as far as my observations are considered, the report you are making use of belong to a category where the User object acts as a context and I came to this conclusion as you aren't making use of the 'contextIds' argument. If we carefully observe the code snippet(specified by you in the previous comments), only two arguments namely reportId and pagingInfo are being used and I believe these wouldn't cause a problem definitely as these are pretty straight forward and simple configurations. I am assuming that the Document (Portal Report) object is accessible to all the users under whom the query needs to be made.

    So the issue could be with the context which is substituted with logged in user during the execution of the function. There shouldn't be any problem with the context as long as you execute the expression from the Designer Interface (Context is Logged In User) or SAIL interface (Context is Logged In User or Task Owner) as the context is quite clear. To the best of my knowledge, the expression behaves differently only when it's used else where because the context varies based on the place in which the expression is being utilised. Documentation at https://forum.appian.com/suite/help/16.2/User_Contexts_for_Expressions.html speaks re how the context varies in various places.

    So let's take the code snippet of yours as an example. Assume that you have assigned a task to me in which the code snippet will be executed upon interaction with a SAIL component. Then the code snippet will be executed with @sikhivahans as context. If you execute the same code snippet in the designer portal, it will be executed with @harshav as the context. Now let's say the same code snippet is included in the script task in the process model that is designed by a user namely john.doe and let's say the node is configured to run as designer. In this case, the code snippet will be executed with @john.doe as context. In case, if the node is configured to run as initiator, the same code snippet will be executed with pp!initiator as context. In all these cases, there is a chance for significant variance in the results as the context is varying.

    I have used the Portal to SAIL plugin extensively and as far as my experience is considered, there isn't any problem(except Performance).
Children
No Data