Challenges with Endpoint, Component, and External REST API Request and Variable Declaration
Hello Community!
I'm going to do my best to explain my current challenge. First, I'll start with the objective....
We have an external data which stores information about users. The primary key is the user's email address which we can obtain easily by calling the Lithium API endpoint (user.email). Our objective is to leverage specific attributes obtained from the external data store to display information w/n a component. For example, we might mark a customer for 'Enhanced Support' in our external data source and need to show the related support options to them within a custom component.
Now the problem...
There are various variations of these variables, so using a template (.tmpl) doesn't seem to meet our use case because within these you cannot define an if/then/else or case statement. However, I also can't find how to set variables server-side from within the endpoint (ftl) that make these available to be called from the custom component. I've been able to complete declaring the variables client-side with JS, but, of course, that can't be accessed server-side.
I hope this makes sense...now, does anyone have any thoughts on how to workaround/solve this problem?