How to update multiple records

I have created a custom integer field on the article.

I want to copy the data of the existing field Usages (Used as solution) field to the custom field CustomField

To copy the data for upcoming changes, I have created a rule to set the value of field CustomField as same value from Usages

But for existing articles, I want to copy the data from Usages field to CustomField and do a mass update

Could anyone please share steps on how to do this?

Tags:

  • Verified Answer

    +1  

    Hi Pandrangi,

    For the type of action you are trying to do, it might be worth using the SMAX Integration Engine. That way you could then update an Article based whether your custom field has a value set or not.

    You could use a scenario whereby you pull back all the Articles to create an Array. Then for each Article update the record with the appropriate value from the Usage field to the Custom field.

    Then you could use a Business Rule to trigger the integration if needed in the future or just run it from the Integration studio if a one time only requirement.

  • 0   in reply to   

    Hi Dave

    I'm facing issues with updating the records using integration in SMAX. Could you please share steps on how to do the complete mass update process?

  • Verified Answer

    +1   in reply to   

    Hi Pandrangi

    Overall to make this type of Integration work you need a scenario that looks something similar to this:

    The Prepare data only has a small number of fields that I'm going to use throughout the scenario:

    Next I want to pull back all the articles from SMAX

    I've highlighted the key areas in what I'm wanting to extract. The Filter so only Articles that have no value set to the CustomField_c then only bring back three fields in the json payload using the layout.

    the size field I set to 100 but this should be altered to match however many records you need to update.

    Finally what information do I want from the Output as this will be used for my array to sift through.

    Next is to have the Apply to each as I want update every record in the Array that I captured from the previous step

    Now I want to update the records

    Here I use the item.properties.<key> to extract the Smax record Id and Usages fields from the array items so that I know I'm updating the fields I need.

    Then when I check my Smax record I see the following:

  • 0   in reply to   

    I attempted in the same manner through the final step.

    I'm not sure what the values for the EMS API / Manage Record (Single) payload should be.

    Thank you for the detailed steps

  • 0   in reply to   

    Hi Pandrangi,

    In regards to working out what values to use, the best way I find is if I'm trying to use the EMS Rest Api using a tool like Postman or something similar.

    Then you can understand what the POST or GET query needs to look like and then understand if its working before trying to implement within the Integration Studio. As all the Integration Studio is doing is making use of the EMS API.

    Here is a useful link:

    EMS REST API - Service Management Automation X (microfocus.com)

    That way you know what the structure of the Rest call should be, now you are just trying to get the Integration Engine to produce that output in order to create/update a record in SMAX.

    So you then know what are fields you are trying to update and with what value. This will be based upon the payloads from the previous jobs within the Integration Scenario. As you only had one field that needs updating which is the CustomField the payload should be fairly straight forward. I just put the Id in to make sure the right record is being updated.

    The Payload is basically just what needs to be loaded into the EMS Api, which is built out by the inputs:

    Data.Record is the Article record type

    Id is worked out from Item.properties.Id. So the array which holds the SMAXArticles.Entities json output then holds the properties.Id, properties.DisplayLabel and properties.Usages

    CustomField_c is our custom field in the Article Record. I want to populate this with the properties.usages value.

    Another thing you can do is to look at the Endpoint for the SMAX integration. If you look at the outputs for each section you'll see what has been generated and then that will help to understand what you are then trying to use in the next step as the input. Again you can refer to the output you got from Postman to see if they match up in anyway.

    Hopefully that adds a bit more clarity around how the Integration Scenario hangs together.