Export to Excel in Records working in Tempo but not in Grid

Hi All,

I have a Record type configured in a Grid and the Grid i have configured some set of columns which are coming from the Record Type.

The Export to excel button works in Tempo.

However in the Grid when we configure the Export to Excel button It is throwing an error. 

It says expression evaluation error at function if parameter 2 line 73 invalid symbol found comma.

But when i validate the interface it is working fine.

Can someone help me out.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    The message

    It says expression evaluation error at function if parameter 2 line 73 invalid symbol found comma.

    is a hint to a possible syntax error in the code. Can you share that code?

  • a!gridColumn(
    label: "Org - Position Desc",
    sortField: 'recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{orgPosition}orgPosition',
    value:
    a!richTextDisplayField(
    value: {
    a!richTextItem(
    text: fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{orgPosition}orgPosition'],
    color: if(
    a!isNullOrEmpty(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{updatedFields}updatedFields']
    ),
    "STANDARD",
    if(
    contains(
    trim(
    split(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{updatedFields}updatedFields'],
    ";"
    )
    ),
    "orgPosition"
    ),
    "#FFBF00",
    "STANDARD"
    )
    ),
    style: if(
    a!isNullOrEmpty(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}As.fields.{updatedFields}updatedFields']
    ),
    "PLAIN",
    if(
    contains(
    trim(
    split(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{updatedFields}updatedFields'],
    ";"
    )
    ),
    "orgPosition"
    ),
    "STRONG",
    "PLAIN"
    )
    )
    )
    }
    ),
    width: "NARROW_PLUS"
    ),

  • Hi this is the above code and its working in tempo perfectly fine. But not in the Grid which i have configured in the interface.

  • 0
    Certified Lead Developer
    in reply to harshav

    I don't think there is a problem with this code. Can you please paste the entire interface codebase once instead of just a gridColumn to help you further? 

  • the entire grid columns contains the Rich text display fields with colors and style. My quick question to you is will export functionality depends on the entire interface present or only on the a!gridField data. Reason why i am asking is if it is with the entire interface i have multiple interfaces which i need to check. if it is a grid field then i have copied the entire set into the recordlist and clicked on export from tempo... but that works... not sure what is the issue.

  • 0
    Certified Lead Developer
    in reply to harshav

    https://docs.appian.com/suite/help/21.4/record-list.html#add-an-export-to-excel-button

    This mentions some restrictions. I would try to remove any special formatting and try to export this. If this works, go back to the complex formatting step by step.

  • I'd also suggest trying to pinpoint the problem - often I do this by commenting out part of the expression to get to a state that works correctly. Then, you can slowly start to add configurations back in until you identify where the problem occurs. If you then can find a specific line that is causing the issue, let us know and we can help you troubleshoot it further.

  • thanks and I tried commenting each column and then started to uncomment each grid column. Till the uncommented the below code everything is working fine.

    After this code only the error started to come in the excel

    .Expression evaluation error: Expression evaluation error at function 'if' parameter 2 [line 73]: Invalid symbol found (comma)

    From this  i can rule out my question asked above, The export excel is only looking at the grid Field code.

    Now when i copied the same code in the record list and exported it is working absolutely fine.

    I also removed the richtext Field and called only the fv!row[record]s.fields.orgPosition, It exported. it is only getting this error only at the richtext Display field.

    Not sure where is the error. Can you please help. 

    a!gridColumn(
    label: "Org - Position",
    sortField: 'recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{orgPosition}orgPosition',
    value:
    a!richTextDisplayField(
    value: {
    a!richTextItem(
    text: fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{orgPosition}orgPosition'],
    color: if(
    a!isNullOrEmpty(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.{updatedFields}updatedFields']
    ),
    "STANDARD",
    if(
    contains(
    trim(
    split(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{updatedFields}updatedFields'],
    ";"
    )
    ),
    "orgPosition"
    ),
    "#FFBF00",
    "STANDARD"
    )
    ),
    style: if(
    a!isNullOrEmpty(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.{updatedFields}updatedFields']
    ),
    "PLAIN",
    if(
    contains(
    trim(
    split(
    fv!row['recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{updatedFields}updatedFields'],
    ";"
    )
    ),
    "orgPosition"
    ),
    "STRONG",
    "PLAIN"
    )
    )
    )
    }
    ),
    width: "NARROW_PLUS"
    ),

  • Just to highlight if this helps that my first column in the grid is a tag field. which is also with colors when exported it just exported as a plain text.

  • 0
    Appian Employee
    in reply to harshav

    If that is your exact code, something seems wrong about your record field references. You have two different ways you're currently referencing your fields:

    'recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.{updatedFields}updatedFields'

    'recordType!{d806002b-c5b8-4f1f-b67e-f5ffa63826a4}s.fields.{updatedFields}updatedFields'

    I believe the second of these is the correct one because it includes "fields" between the record type UUID and the field name. Can you try to update these record fields references and see if that fixes your issue?