Hello, I have a scenario in my app where I need to retrieve a value from the database and pass it as an argument to a custom action. This value is the API URI that the custom action will call.
The button titled “dynamic hardcoded api call no list” needs to grab an API URI from the database and pass it to the custom action that is tied to the click of the button. In my real app, this will need to occur for every custom action and any custom component that makes API calls.
The button titled “dynamic hardcoded api call” is able to solve the above problem by being part of a List. The list is of the “api” collection. The list has access to the Database record, and so it passes the field “url” within the “current api” to the custom action. The result is that the button click successfully calls the API URI that is configured in the Database, which is the desired result.
The issue is that in my real app, I would have to turn most elements into lists just so they can access the API URI, but this is not feasible. Is there a way of achieving this without using lists?
Here is where I need to access the database value and register it as magic text for the custom action:
This is what the custom action looks like:
This is exactly what I need to happen, but without using a list. This is a list of the collection “api” and it allows me to access the database value.
To clarify, buttons #1, #2, and #4 work the way I need, but #3 doesn’t. #3 needs to behave the same way that #4 behaves, but without configuring it as a List.