Skip to main content
September 18, 2023
Solved

Im so desperate for help :(

  • September 18, 2023
  • 10 replies
  • 0 views

I am getting the above error , what does it mean and how to fix it? 

I am trying to add the document in the grid , and save to its record type. 

The rule input Doc is defined as (array) could this be where the problem is? 

                   a!sectionLayout(
                label: "Documentation Details ",
                labelIcon: "file-text",
                labelSize: "SMALL",
                labelColor: "STANDARD",
                contents: {
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {    a!gridLayout(
                          totalCount: count(ri!Doc),
                          headerCells: {
                            a!gridLayoutHeaderCell(label: "Document" ),
                            a!gridLayoutHeaderCell(label: "Name" ),
                            a!gridLayoutHeaderCell(label: "Classification" ),
                            a!gridLayoutHeaderCell(label: "Uploaded By" ),
                            a!gridLayoutHeaderCell(label: "Uploaded On" )
                          },
                          columnConfigs: {
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:2 )

                          },
                          rows: a!forEach(
                            items: ri!Doc, /*localdata*/
                            expression: a!gridRowLayout(
                              id: fv!index,
                              contents: {
                                a!fileUploadField(
                                  target: cons!SKJ_DOCUMENTS_FOLDER,
                                  maxSelections: 1,
                                  value: /*local!doc,*/
                                 fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6c686146-7506-45c1-b2e6-1db2e0eb6900}appianDocId'],
                                  
                                  saveInto:
                                  {/*local!doc*/
                                    fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6c686146-7506-45c1-b2e6-1db2e0eb6900}appianDocId'],
                                  a!save(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{66325d17-158b-4776-98b3-761a5a458e5c}addedBy'],loggedInUser()),
                                  a!save(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{601d2c71-2a27-48c0-939b-61ff68722c5a}requestId'],1),
                                  a!save(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{1fc16e35-b769-46b0-8d9e-9dc633cbb090}addedOn'],today()),
                                  a!save(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{f65ae4e8-afd3-4a5a-80c7-3c67d225a274}docName'],extract(fn!getcontentobjectdetailsbyid(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6c686146-7506-45c1-b2e6-1db2e0eb6900}appianDocId']), "Name:", "."))
                                  
                              
                                  /*      a!save(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6d510991-df65-4ae0-a9b9-179a36931fb0}docId'],document(documentId: local!doc, property: "id"))*/
                                  },
                                  buttonDisplay:"ICON",buttonStyle: "STANDARD"),



                                  a!textField(
                                    value:/* if(a!isNullOrEmpty(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6c686146-7506-45c1-b2e6-1db2e0eb6900}appianDocId']),extract(fn!getcontentobjectdetailsbyid(fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{6c686146-7506-45c1-b2e6-1db2e0eb6900}appianDocId']), "Name:", "."),""),*/
                                    
                                    saveInto:   'recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{f65ae4e8-afd3-4a5a-80c7-3c67d225a274}docName'
                                    
                              
                                  ),

                                  /* For the Department Column*/
                                  a!dropdownField(
                                    label: "department " & fv!index,
                                    placeholder: "-- Select -- ",
                                    choiceLabels: { "First", "Sec"},
                                    choiceValues: { 1, 2 },
                                    value: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{a3f411dd-394e-4039-a2d0-600d333f94b0}classification'],
                                    saveInto:fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{a3f411dd-394e-4039-a2d0-600d333f94b0}classification'],
                                    required:false
                                  ),
                                  a!textField(
                                    value:local!addedBy ,/*fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{f65ae4e8-afd3-4a5a-80c7-3c67d225a274}docName'],*/
                                    saveInto:fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{66325d17-158b-4776-98b3-761a5a458e5c}addedBy'],                               
                                    required:true
                                  ),
                                  a!textField(
                                    value: today(),
                                    saveInto: fv!item['recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document.fields.{1fc16e35-b769-46b0-8d9e-9dc633cbb090}addedOn'],
                                 
                                    required:true
                                  )
                              }
                            )
                          ),
    showWhen: not(isnull(index(local!selectedEmployees,1,"null").accountId)),
                          addRowlink: a!dynamicLink(
                            label: "Add Document",
                               value:   append(ri!Doc,'recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document'()) ,
                                /*startDate: today() + 1},*/
                               saveInto: {
                                 a!save(
                                   ri!Doc,
                                   append(ri!doc, 'recordType!{52d6bfd4-9a4e-457c-ab2e-ede6cffdb054}SKJ Document')
                                 )
                               }
                        


                        
                          /*  saveInto: {
                              a!save(local!document, append(local!document, save!value))




                            }*/
                          ),
                          rowHeader: 1
                        )
                
                        }
                      )
                
             

              
                    }
                  )
                },
                showWhen: not(isnull(index(local!selectedEmployees,1,"null").accountId))
                
              )

Please look at my code and help me 

Best answer by mikes0011

In addition to the misconfiguration in the task, you apparently have an error either in the configuration of your Start Form configuration (i.e. the process model side configuration), or perhaps in the SAIL interface itself.  It looks like you have the literal phrase "then saveinto" saved somewhere that it doesn't belong (and isn't syntactically valid).

10 replies

mikes0011
Brainy
September 18, 2023

What's the type of pv!Doc (that is, the variable configured in the Process Model)?  Is it the same type AND also set to "multiple"?

September 18, 2023

The value should be "Doc" this is how I defined the rule input in the code (as in image 3) , 

I think it say "Multiple" because i set the rule input as Array ,

but when i don't set it as array the code results an error  

September 18, 2023

The type of Doc is a record type "Document "

September 18, 2023

Hello,

to looks like the Script task is not connected to the flow (path). Can you connect script task node to the outgoing flow from write Records node and try?

mikes0011
Brainy
September 18, 2023

You're right, that's also an issue here (related to the top line of the error output only, nothing to do with "pv!Doc" or the stuff related to it).  I completely missed that.