Hi, I have an external API that accepts either te...
# gooddata-cloud
v
Hi, I have an external API that accepts either text or file input and returns a JSON response which I need to use to create visualizations in GoodData During my search, I came across FlexConnect in GoodData. It seems like it might require: 1. Hosting a FlexConnect server. 2. Creating a function in the FlexConnect template code to hit the API and return data. 3. Configuring the server as a data source to a workspace. This setup would update the data model involving two data sources, allowing dashboards to be generated using it. Are these the correct steps to achieve this, or have I missed any implementation details? Thank you.
j
Hi, you are correct. Two sources will be needed only if you need to combine data from the API with other data source such as some data warehouse connected via a different connector.
r
What Jakub said 🙂 Additionally, while there's a lot of info on the website, we also get very detailed in the FlexConnect template repository!
v
Hi Jakub and Radek thanks for providing more information on this. I will look into the Flex connect template repository for implementation details.
Hi @Radek Novacek, I am wondering if it is possible to pass a manually typed string or a file input as a filter in the GoodData dashboard. This functionality is needed because the external API I am integrating through FlexConnect is not limited to a predefined set of values from a dropdown as input.
Hi @Radek Novacek, just following up to see if you have any insights regarding my previous question. Any information would be helpful. Thanks
j
The attribute filters in UI let you select only values from the list obtained via FlexConnect call. The table function in FlexConnect server can identify call with a request for the list of values. Here is an example which returns values “Celsius” and “Farenheit” for attribute “Units”:
Copy code
if execution_context.execution_type == ExecutionType.LABEL_ELEMENTS:
           if execution_context.attributes[0].attribute_identifier=="Units":
                output = {
                   "Units": ["Celsius","Farenheit"],
                }
                return pyarrow.table(output)
This example returns static list but you can also obtain list of values from results obtained by external API call. The filters for specific values which are not provided by FlexConnect can be also specified in MAQL WHERE condition expressions. Will any of the proposed solutions work for you? I will mark your request “to pass a manually typed string or a file input as a filter in the GoodData instead of selecting values from the list” as product feedback.
🙌 1
p
🎉 New note created.