Linking Information through Data Detail and Server Connects

Hi Wappler Community!

I have put all my server connects and my data details on my layout page to use. I’m trying to create a simple website where I have a company list > company details > and it pulls up a list of general topics about the company that once clicked > granular view of details. A screenshot below to explain what I mean.


In this image the Defense and Offense Stance is selected. What I want to know is how do I match it so that when my company has been selected above, the information below only relates to that one company.

image
This is my layout page server. connects

I also would like instead of it saying Company ID and Employee ID the company’s name and the employee’s name. I know this would most likely be done through a query, but I haven’t played around with that yet. Any resources to help me search further into these topics would be super helpful. Thanks to everyone who has helped me thus far.

Ideally when I click on add a new defense and offense stance as well it will automatically know the company it’s adding too, and which employee is adding it. That way these fields won’t need to be manually inputted.

Hey @Parker_Jacobs,

What you’re up to is easy…
(But please share screenshots or your code to understand what we are talking about)

Let’s start with the company name listed in your query
In order to get the Company Name listed in your defoffstanceconnect query you have to add a join in your query:

  • In your database query builder fiirst add the deoffence table, click on the fields/columns you want to pull inside thequery
  • add a Join table, the Companies (the table that contains the company name), set the columns that will connect the tables

If you can’t do it, open the database builder and if you need help send me screenshots to help you

(I share screenshots of my setup with products table. Each product has a catefory id and I list it pulling it with a join from the categories table)


Amazing! I have all the CRUD functionality already in my APIs but for right now I really want to focus on when I add defoffstance for the Employee_ID and the Company_ID to be auto inputted. Do you know how I would go about doing this?

please…


I need my Company_Id to match what company is already selected, and I need my employee_Id to reflect who is logged in

This is defined in your read serveraction (1st picture).
You mean to list the company name and the Employee name instead of their ids?

Hi Famousmag. Sorry I’m making this more confusing than it needs to be. Thanks to you my inner join’s are working and I’m displaying the correct information. The Read functionality in my CRUD works great. I am moving on to the Create part of my CRUD operation now. When I pull up my form (previous picture) I want my company_ID to be autofilled based on what company is selected, and I want my employee_id to be filled based on what employee is logged in.

  1. you can pull the Company id from the data detail, that you have already selected the company, right?

  2. You can get the security identify in any serveraction you want and use for filtering or assigning anything you want
    BUT, I personally have added a security identify in the Globals in order to have it available everywhere without adding it again in any serveraction

Thank you! This is very helpful. How would it work in this scenario as well:

where when I click on company WOAH, and the Offense and Defense Stance, it’ll only show Company WOAH and not SNAP. The way I have it wired right now it only works when WOAH and SNAP are the highlighted ones, not when any other company is highlighted because there isn’t information for them yet.

I haven’t understood completely how your data are connected and which serverconnect give what…

But I would suppose that you must define a filter IN THE YELLOW DATASOURSE like “Green.ticker == yellow.Ticker”
if you understand what I mean… otherwise you have to show me the whole workflow

I have this security identifier:


you’re saying instead of an API action make this under my globals to be able to always reference?

Yes, except I go by company_ID. Is there a way to easily do this because right now I’m using show commands through data detail when my defoff stance data detail selects company_id.

My Company server connect is for the company list, I use data detail to display the details on the right. I then made a navbar that when clicked I use my def_off_stance server connects to display the information in yellow. I am trying to use data detail to show when buttons are clicked, but I can’t make it work. I got close and it was working when the right company was selected and I clicked the button it would display the table, but when I added another datapoint now it works for both companies and displays both at the same time. That’s no good.

Here’s how it’s all linked together.

You want the Yellow table to show only the records that where Employee_id == Security_Identity?
Then you have to define that filter to the yellow table datasourse when you click the navbar button.

Show me the code of the navbar click event…

I want the yellow table to only display the information for only one company, in this case I only want information for the company WOAH

So… define that filter over in that datasorce…

If you don’t understand please share your code clicking the navbar item… What you’re doing there?

I think you could define a filter on your datadetail (data_detaildefoffstance) then…
Something like that:

data_detaildefoffstance.company_id == Company_list.company_id

(translate it to your case)