Hello Bubble-Forum,
I’m new to Bubble and have been having a problem for a week which I can’t solve and I can’t find any solutions on the internet.
The initial situation:
I have 2 data types “ESG-Ratings” and “Medicare 12.06.24”
“ESG Rating” is a list of pharmaceutical companies and their individual ESG ratings. There are the columns “Unternehmen” (Company Name in German) and the columns of the ratings “Sustainalytics” and “Science based Target”. Each company has only one entry with the different ratings.
“Medicare 12.06.24” is a comprehensive list of all drugs and their main ingredient produced by the individual companies. There are the columns “Zulassungsinhaber” (is the same as the company name in german), “Wirkstoff” (main ingredient in German) and “Medikament” (drugs in German).
I filter for main ingredient via a search input and get a list that shows all companies that produce the active ingredient. That works perfectly!
Now I also want to display the ESG ratings for the companies. Unfortunately this does not work. So far I always get the same values for all companies.
I need a condition that only shows me the filtered companies of “Input A” from “Medicare 12.06.24” and shows the matching values for “Sustainalytics” and “Science Target based” from “ESG Ratings”.
Knowing that Drugs data type has a field that is related to the Company data type (not a text field of the name, but a field that is related to the company data type), then you create an RG that has the content set to Company and the datasource is ‘do a search for drugs with constraint of main ingredient each items company’
So what you are doing is the same thing you already basically are which works, in terms of searching for Drugs that have an ingredient that matches the inputs value, the difference is your RG content type is Company and the search expression uses each items Company. Then what you are doing is actually showing an RG with a list of companies and all of their data such as the ESG ratings.
thanks for your quick reply
I have not linked the two data types Company and Drugs.
Both data types only have “simple” field types such as text or number.
How do I relate the two data types via the Company Name?
Normally this would work via primary keys and foreign keys, but I can’t find this option.
I have linked the company to drugs (field type: company) as you mentioned. The problem is that there are no values in the column. I had to add these values manually.
But with these two test values the search works! Thank you very much!!!
Is there any way to automatically insert the other 2500 linked values? As I said before, I had to add the two test values manually by using the pencil icon on the left side.
Create a backend workflow. Make a parameter be the data type of Drug. As an action, use a make changes to thing, the thing to change is the parameter of Drug. Then to populate your Company field with the related Company data type you will need to run a search for company whose name field matches the drugs type company name field.
I would then run this backend workflow through the bulk operation in the data tab