Logic Apps do not allow parsing expressions at runtime, but there are options for doing something like this without complicating your workflow.
If you are on the new Logic Apps standard plan, then you get access to the Execute JavaScript action which is still in preview. While Logic Apps doesn't allow you to evaluate code dynamically, JavaScript does.
I added a Parse JSON action to my version just to make the expression a little simpler, but basically the code boils down to return eval(<string retrieved from cosmos>)
The second option would be essentially the same but leveraging Azure Functions. It's quite a bit more cumbersome, but it works on the Logic Apps consumption plan and you have more language options if you don't want to utilize JavaScript.