Skip to main content
New Participant
January 23, 2025
Question

Updating Constant by using Update Constant Smart Service

  • January 23, 2025
  • 3 replies
  • 10 views

I have a requirement where i  am updating the constant by using update constant smart service .The constant is having multiple values when i am updating the constant all values are getting updated with new value.Is there any way where we can update the constant at particular position.

Example: I have a constant with values {"Apple","Grapes","Orange"}, by using update constant  smart service i need to update constant value Grapes to Pomegranates remaining values should not be modified.

Thanks in advance

3 replies

stefanhelzle0001
Brainy
January 23, 2025

Sure, you can read the constant values, modify them and make this logic the new value for the constant.

sirik7052Author
New Participant
January 23, 2025

I have tried but failed somewhere. forgot to mention i have MNI for updated constant I have 2 constants to get updated 6 values .For 5 values we are using same constant for 1 value we have to update separate constant.The Constant which is having 5 values we need to 3rd position value

stefanhelzle0001
Brainy
January 23, 2025

Not knowing your exact requirements, in general the idea is to do something like this:

a!update(
  data: cons!YOUR_CONSTANT,
  index: 3,
  value: "YOUR_NEW_VALUE"
)

This would modify the third item in that constant. use this in that smart service to define the new value.