4 Replies Latest reply on Oct 11, 2017 11:57 AM by AnthonyDowns

    Expression to increase the count +1 with a quick action.

    sleahy Rookie

      So I have a simple task that I think i'm over thinking and don't know how to build the proper expression to accomplish what I want.

       

      Simply put, I want a quick action when someone clicks on a command button to increase the count of the CountUseful field in Knowledge by 1.

       

      Currently out of the box there is a quick action  that calculates the Helpful and Not Helpful count based on the Feedback articles created. Instead I want a simple expression that says Update CountUseful to +1 of the current value whenever the quick action is called.

       

      Seems simple enough, but i'm tripping over how to write it in the expression builder.

       

      thanks.

        • 1. Re: Expression to increase the count +1 with a quick action.
          JulianWigman Master

          I think maybe from the subject matter you probably meant to post this in the Service Manager forum rather than the Service Desk one?

           

          Julian

          @MarXtar

          • 2. Re: Expression to increase the count +1 with a quick action.
            AnthonyDowns Apprentice

            That should be easy enough using the update object quick action. On the the CountUseful field, inside the update object you could add $(CountUseful + 1).

             

            However, a user could just click the button multiple times and inflate the counter.

            • 3. Re: Expression to increase the count +1 with a quick action.
              sleahy Rookie

              Thanks that's all I needed. And you're right there is a concern that someone could inflate the numbers.

               

              What I'm doing currently is having a Composite Quick Action make a new feedback article with the check box for Was Helpful checked. Then I have the same steps as the 'Calculate Rating' quick action run. This works but the count is always 1 off because it makes the article and calculates at the same time so it doesn't know the new article is created.

               

              So if the count is 0, it makes 1 feedback and calculates it to 0, the next time my QA is ran it updates the count but only shows 1 (since the feedback was created the first time) with 2 feedback articles created. If i manually run the Calculate Rating it true ups the count.

               

              My end goal is for someone who wouldn't necessarily have rights to edit an article but searches for something that is helpful could simply click on a button and bump the count for helpful by 1 while making the feedback article.

              • 4. Re: Expression to increase the count +1 with a quick action.
                AnthonyDowns Apprentice

                Hmmm. Being a composite action I don't think you could make it wait to do the calculation till after the insert. Maybe a triggered action? On KMFeedback you might be able to make a triggered action on object insert that would do the calculation for the parent article.