Skip to main content
Inspiring
Sep 10, 2021 9:58 AM UTC
Question

An error occurred while executing a save: Expression evaluation error: The save target must be a local variable that does not refresh on every evaluation or on an interval, a process variable, or a node input

title as above,

code as:

a!save(target:ri!userinputsheet.KONE_user_name,value:fv!item.KONE_user_name),
                a!save(target:ri!userinputsheet.FIRST_NAME,value:fv!item.FIRST_NAME),
                a!save(target:ri!userinputsheet.LAST_NAME,value:fv!item.LAST_NAME),
                a!save(target:ri!userinputsheet.Email,value:fv!item.Email),
                a!save(target:ri!userinputsheet.Role,value:fv!item.Role),
                a!save(target:ri!userinputsheet.Branch,value:fv!item.Branch),
                a!save(target:ri!userinputsheet.Region,value:fv!item.Region),
                a!save(target:ri!userinputsheet.Manager_role,value:fv!item.Manager_role),
                a!save(target:ri!userinputsheet.Telephone_number,value:fv!item.Telephone_number),
                a!save(target:ri!userinputsheet.CE_LEVEL,value:fv!item.CE_LEVEL),
                a!save(target:ri!userinputsheet.Active,value:fv!item.Active),
                a!save(target:ri!userinputsheet.Language,value:fv!item.Language),
                a!save(target:ri!userinputsheet.Exceptional_case_library_view_right,value:fv!item.Exceptional_case_library_view_right),
                a!save(target:ri!userinputsheet.updateTime,value:now()),
                a!writeToMultipleDataStoreEntities(
                  valuesToStore: {
                    a!entityData(entity: cons!KONE_Development_userinputsheet_Constant, data: ri!userinputsheet),
                    a!entityData(entity: cons!KONE_Development_userrole_Constant, data: ri!userrole)
                  }
                )

what is the problem?

    21 replies

    gabriele.camilli
    Employee
    Sep 10, 2021 10:54 AM UTC

    Hi,

    The problem may be that the write to datastore is not on the correct component

    Is this saveinto into a button or similar component?

    docs.appian.com/.../Write_to_Data_Store_Entity_Smart_Service.html

    Also if it's not necessary, i would advise to not save directly from the interface but to use a process model

    Inspiring
    Sep 10, 2021 10:55 AM UTC

    saveinto button

    gabriele.camilli
    Employee
    Sep 10, 2021 10:57 AM UTC

    could you share the whole button code?

    ravir0002
    Participating Frequently
    Sep 13, 2021 7:11 AM UTC

    Can you try to comment the Write to Data store entity code and try, if is works, it means there is something wrong with DSE. So we can check there.

    Inspiring
    Sep 13, 2021 7:30 AM UTC

    still report

    ravir0002
    Participating Frequently
    Sep 13, 2021 9:38 AM UTC

    a!save(
    target: ri!userinputsheet.Language,
    value: if(
    isnull(ri!userinputsheet.Language),
    "Chinese",
    ri!userinputsheet.Language
    )
    ),

    Try above code on save into for language.