Skip to main content
April 18, 2022
Question

how to update field in databse using a!update

  • April 18, 2022
  • 6 replies
  • 0 views

I have created expression rule to find data like {{changeid:"1234",prioritystatus:null}}

now i want to update this list of dictionary using a!update how can i do that? i want to update that field prioritystatus. I am doing this by selection of one prioritylist in dropdown box.

I have done this in user interface and on changing this status it will update the above field in this list of dictionary. But it gives error.

I have done like this:

a!update (data:{{changeid:"1234",prioritystatus:null}},index:"prioritystatus",value:1)

    6 replies

    April 18, 2022

    Hi,

    You are passing a list of items in your data. Try this way it will work

    a!update(
    a!map(changeid: "1234", prioritystatus: null),
    "prioritystatus",
    1
    )

    If you want to update list of values use below logic

    a!update(
    {
    a!map(changeid: "1234", prioritystatus: null),
    a!map(changeid: "4567", prioritystatus: null)
    },
    "prioritystatus",
    {1,2}
    )

    April 19, 2022

     if(fv!item.status=69,a!update(data:a!map(local!clist[1]),index:"prioritystatus",value:local!pstatus1),"")},

    I have done this. I got above error.

    Please give me solution.

    stefanhelzle0001
    Brainy
    April 19, 2022

    This

    a!map(local!clist[1])

    does not work. Try the following:

    if(
      fv!item.status=69,
      a!update(
        data: local!clist[1],
        index:"prioritystatus",
        value:local!pstatus1),
      ""
    )
    },