Sometimes there is no value after converting elapsed time in portal.

I am using "getportalreportdatasubset" and APPIAN 7.7 . Here I am facing strange issue with the report column named "Elapsed time" which is saved as "Duration" data type in portal report.
Expression to Calculate Elapsed time is : pp!starttime-(if(find("/",pv!cdtClientReportDetails.DocCreatedDate)=0,gmt(datetime(left(pv!cdtClientReportDetails.DocCreatedDate,4),mid(pv!cdtClientReportDetails.DocCreatedDate,6,2),mid(pv!cdtClientReportDetails.DocCreatedDate,9,2),mid(pv!cdtClientReportDetails.DocCreatedDate,12,2),mid(pv!cdtClientReportDetails.DocCreatedDate,15,2),right(pv!cdtClientReportDetails.DocCreatedDate,2))),gmt(pv!cdtClientReportDetails.DocCreatedDate)))

I have created new column and saved value of this "Elapsed time" (same expression) as Number(Rounded to 2 Decimal Places).I am converting this decimal value in Year, days, hours format in my SAIL code, For this I am using expression rule , Sometimes I get value sometimes blank value from Portal. Th...

OriginalPostID-151165

OriginalPostID-151165

  Discussion posts and replies are publicly visible

  • ...ere is no major changes in Portal report not any blank data for Elapsed time then why I get Blank data some times and my report shows error in SAIL.
    Is there any issue with "getportalreportdatasubset" and APPIAN 7.7 if we user duration or decimal or convert duration to decimal.
    Any pointer will be helpful.
    Thanks,
    Pooja
  • @poojas May I please know the data type of the input (through which you are accepting the duration returned by getportalreportdatasubset()) in the expression rule?
  • @poojas I don't know how far my observation will help you, but out of my experience, I would like to add one point here - In case of the mismatch between the data type returned by the portal report for a column against the data type configured in the rule which accepts the input from portal report data subset, then empty value is returned.

    One instance where I observed this is - task_assignee_owner() in portal report behaves as 'User or Group' object. But when the report is queried, the same data is being returned as 'Any Type'.
    Now let's assume that we have built a rule which accepts the data from the task_assignee_owner() column and formats the data present in it. The input of this rule should be 'Any Type' but not 'User or Group'. If you configure the rule to accept 'User or Group', empty dataset will be returned. The rule should accept the data as 'Any Type' and casting to 'User or Group' should be done in the rule.
  • I am converting duration in to decimal on my portal report and accepting it in decimal type variable on SAIL
  • @poojas It would be worth giving a try by doing as follows:

    Approach - 1:
    1. Change the data type of the input in the expression to 'Any Type'
    2. Cast the input from 'Any Type' to Decimal in the expression.

    Approach - 2:
    Else cast the contents of the desired column in the datasubset to Decimal and then pass the resultant data to the expression.

    So, in either of the case make sure that the data of type 'Number Decimal' is passed to the expression because the data we obtain from the portal report is not the same as the data type we see in the portal report.

    Hope the above approach might give you some leads.