Skip to main content
felixr
June 22, 2022
Solved

Is there any way of getting the constant Id or something to update a constant with the update constant smart service

  • June 22, 2022
  • 6 replies
  • 0 views

    Best answer by peter.lewis

    If you're going to have that many items, I'd suggest creating a database table to manage the items instead of 30 constants. Then you can set up a value for each of your companies and just use a write to data store to update them whenever you need to.

    6 replies

    peter.lewis
    Employee
    June 22, 2022

    I'm not aware of a way to do it within a single node, but perhaps you could do it using a gateway instead? You could two separate nodes that each point to different constants you want to update and have a gateway that uses your logic to decide which to execute.

    felixr
    felixrAuthor
    June 22, 2022

    Thanks for replaying [mention:6b9f80ff18f9420082d13ef2d5121d56:e9ed411860ed4f2ba0265705b8793d05]  I know i could  do it like that but  in my case i will manage around  30 companies  and that would  be a lot of work   i have to get token for all of them that´s why i wanted to do it this way 

    peter.lewis
    Employee
    June 22, 2022

    If you're going to have that many items, I'd suggest creating a database table to manage the items instead of 30 constants. Then you can set up a value for each of your companies and just use a write to data store to update them whenever you need to.

    mikes0011
    Brainy
    June 22, 2022

    Assuming you have access to the Content Tools plug-in, you should be able to pass a constant name and grab its UUID and then its Object ID using a combination of rules.  I'd suggest you encapsulate this in an expression rule for the sake of error handling, but here it is at its core:

    extract(
      getcontentdetailsbyuuid(
        getconstantorruleuuidbyname("TEST_CONSTANT_NAME")
      ),
      "Id: ",
      ", Parent:"
    )

    The Expression Guru
    felixr
    felixrAuthor
    June 22, 2022

    Thanks a lot