I have a excel file where there are too columns one is constant name and another is constant value .I need to upload a the file in an interface using file upload component and after clicking a submit button in the interface i need to fetch the data in the excel and update the constant values for respected constants . will anyone please guide me to achieve this scenario ?I have also given the snap of the excel sheet ,please find that below.
Thanks in advance !
Discussion posts and replies are publicly visible
I don't know whether this will work - the Update Constant Smart Service requires a reference to the constant, I don't think you can use a Constant Name instead.
Edit: sorry I was wrong. The smart service also accepts the constant's ID (as in, its integer-based environment-specific object ID, similar to a Process Model ID).
Getting the Constant's ID isn't super easy though - you have to use "get constant or rule UUID by name", then the "get content object details by UUID" function and extract the "ID". The quick-and-dirty expression, which could go directly in the "constant" field of the Update Constant smart service, could look like this:
extract( getcontentdetailsbyuuid( getconstantorruleuuidbyname("MY_CONSTANT_NAME")), "Id: ", ", Parent:")
You'd simply replace "MY_CONSTANT_NAME" with the actual constant name. You'd need to be sure the constant name actually exists, otherwise I expect the node would error.
(If anyone has an easier way to do this, i'd love to hear it.)
Thanks a lot Mike Schmitt .It really helped me a lot and also learnt a new thing .