5 Replies Latest reply on Mar 19, 2019 12:55 PM by Laurent Matheo

    How to update a Record field with a process in Innovation?

    Emmanuel Abarca

      Hi there, I have a Record definition called Attachment where I can have up to 3 attachments (Field names: Attachment 1, Attachment 2 and Attachment 3), also I have a field called "Attachment Count" where I want to show with a number in a Record Grid how many attachments does my instance have just after I have created it and its default value is 0. So this Attachment Count value should be updated automatically with the correct number of attachment files when the "Save button" have been pressed with a "Launch Process Action" (for the counting) that will follows a "Save Action" so the process could be applied to the instance I have just created.


      The form for creating a new Attachment instance looks like this:


      And I am taking the following value "Record Editor > Record Instance > ID" for the INPUT MAP of the following process..



      This was my idea of a process that will validate if each of the 3 attachment fields is empty or not, so in the 1st gateway I was asking if "Attachment 1" = NULL then go to the next gateway which does the same but with the Attachment 2 and so on. But I have no idea if the syntax of the condition is correct or if I am using the correct "Attachment 1" value.


      In each of the "Update Record Att#" I was trying to do something like "Attachment Count + 1" in that specific field but again I dont know the exact syntax for that or if something like that could work. I dont even know if I need the "Get Record" activity because I am already asking for the ID of my instance with an input variable in the process which seems to be enough.


      I am kinda new with Innovation Studio and I would be really grateful with any help. The most specific the better.



        • 1. Re: How to update a Record field with a process in Innovation?
          Laurent Matheo

          I guess you could have a process variable:



          And you can use an "Compute Value" activity to do the calculation:



          So you want to do something like:

          attachmentCounter = attachmentCounter + 1


          In the end you will have this:



          In detail, you do the calculation in "Expression Text" (attachmentCounter + 1):



          Then the "Compute Value" activity "Output" will contain the result, so you could say that:

          "compute value.Output" = attachmentCounter + 1


          That is why in the "Output Map" you assign the variable attachmentCounter to the Output:


          In detail for "Source":



          So in the end it is kinda like:

          "compute value.Output" = attachmentCounter + 1

          attachmentCounter = "compute value.Output"


          Then once you have your attachmentCounter you can just use a "Update Record" activity to update your counter field with the variable value.

          Here I mapped the "Description" field with the "attachmentCounter" value. Of course you will need to adapt in your case.

          The Record Id is also a "dummy" one, you will have to use the real record Id (Guid for example).


          1 of 1 people found this helpful
          • 2. Re: How to update a Record field with a process in Innovation?
            Emmanuel Abarca

            Edit: Nevermind, I just realized that I can´t use the same instance ID in to consecutive processes in my "Save button" and that was why I was getting the ERROR 920, so I will figure it out how to combine both processes but I still could use some orientation with my "Attachment 1 = NULL" condition.






            Hello Laurent,


            Thank you so much for your answer, I totally understand your solution but when I try to implement it without any condition or gateway (just trying to update my Attachment Count field to 1) I am getting this error message:

            Sin título 2.png

            The first line should say something like this in english: A new line has been detected in the checker in quotation marks. And in my process I am already asking for a recordID as an input and setting it up correctly in my UpdateRecord Activity as well as the correct Record Definition Name, I dont know what I am missing.


            Also if everything turns ok when I will try to validate if my Attachment fields are empty, is this syntax correct?

            Sin título.png

            "Attachment 1" is the field of Type Attachment where I will upload my files and then with this process check if they are empty or they have a file. So this condition should be in an Exclusive Gateway.


            Again, thank you so much.

            • 3. Re: How to update a Record field with a process in Innovation?
              Laurent Matheo

              I would have to check for the attachment condition.

              As for the save, I wonder if you could use a Rule triggered on "After Create". This way your record should have been saved in database when the rule will fire.

              1 of 1 people found this helpful
              • 4. Re: How to update a Record field with a process in Innovation?
                Emmanuel Abarca

                Thank you so much for your anwer Laurent,


                I have actually succesfully combined the two processes I wanted to use into a single one, and the condition to validate if the attachment is empty works as it should without any error.


                The Compute Value Acitvity and its configuration was everything I needed to make my process work as I wanted just after realizing that I can not use two consecutive processes in the same buttom.


                Thank you again and have a nice day!