Skip to main content
January 21, 2025
Solved

Getting Error while using the update Constant Smart Service

  • January 21, 2025
  • 6 replies
  • 0 views

I have a requirement needs to update multiple constants with corresponding values. I have a constructive data type which will have the constant name in text and corresponding value. I am using update constant smart service to update the constant. Since i have multiple constants i have configured MNI to the smart service. while running the smart service i am getting the error "The constant specified is invalid or does not exist. Constant ID: null."

Thanks in advance for the suggestions

Best answer by davidj137213

How do you get the name of the constants you are going to update? Maybe one of them is null?

6 replies

davidj137213
January 21, 2025

How do you get the name of the constants you are going to update? Maybe one of them is null?

sirik7052Author
January 21, 2025

I prepared the list before calling the smart service

stefanhelzle0001
January 21, 2025

You will have to make sure to only call that smart service if the name is not null.

sirik7052Author
January 21, 2025

I did that null handling too still getting the same error. Could you please tell me what type of data we need to pass to content constant for the smart service

stefanhelzle0001
January 21, 2025

I just checked the smart service. The problem is, that you cannot just pass the name of that constant, but you need a reference to the constant. Or, the content ID.

Using the content tools plugin, I came up with this:

tointeger(split(getcontentdetailsbyuuid(getconstantorruleuuidbyname("SSH_UPDATE_TEST")), ",")[2])

Please test and verify this code to make sure it works for your situation!