Novunex Community

Forum Updating an entity with arrays using the SQL option

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #705
    Avatar photoMark
    Participant

      Quick question, when I use the update activity and have an attribute that is an array what would be the best way to handle it?

      #708
      Dani
      Participant

        Hi,

        I need a little bit more information to be able to answer this question.
        What do you want to do with the array?
        What do you expect the outcome to be?

        Kind Regards

        #709
        Avatar photoMark
        Participant

          Hi Dani,

          an entity can have an attribute that is an array.
          In an Update Activity when I create a SQL query that includes such an attribute I will get the following result:
          Approver = [21,35,43]
          In the Update Activity, I can map the result of the query (value) to the attribute in the entity (key).
          Running this Update Activity creates an error “Foreign key constraint …”.

          Now I can change my query to only have one of the Approvers e.g. Approver = 21
          When I run Update Activity now it adds the approver with Id 21 to the list of existing approvers rather than replacing the current array with the new value.

          What I want to accomplish is to replace the current array with the new list (array) or approvers.

          I hope this helps to better explain the issue.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.