Taking references from 2 different tables to a single tables

Actually I am new to AWS HoneyCode. I just want to create three tables named as Pipelines, contact and Accounts. Accounts table contains Name, industry,Contacts(Primary Key) and Contact table contain name ,email Account(Primary Key).and in pipelines table I want Deal Name,Account(taking reference from Contacts table) and Contacts(taking reference from Accounts table).
when I am trying to join via Wizard feature pipeline is only joining with single table either with Accounts or Contact.On joining with another table it is showing "This table name already exists."
Can Anyone help me to solve my problem.
Do I use filter function If yes... I don't have idea how to use it.

Hi @Aman-1039 ,

I’ve built a lot of database systems with accounts, contacts and a sales pipeline. With that background in mind I have a few questions about the business logic for you. That will help me provide a better answer.

Can multiple contacts be assigned to one account? If so do you need the ability to designate a primary contact? Or is one contact assigned to an account and each account is only assigned to one contact.

For the Pipeline table is the goal to select an account and have the primary contact info transfer over?

Best Regards,

Nancy

Thank you mam for the instant reply, Here I want to assign one contact to an account and each account is only assigned to one contact. And I have one more doubt can I also make an individual column for inserting image in it? If yes, then How?

Perfect now that I understand the business logic here's the approach I would take at a table level
your relationship between the Account and Contact table is a 1 to 1 relationship. In this case you need to add a row link to only one of those tables I choose the Contact Table:

Account Table:

Account Table

Contact Table:
Nanc-5d83_1

For the Account column set format to rowlink and select the Account table.
AccountRowLink

Pipeline Table:
Nanc-5d83_2

  • Account (Set up column format as a Rowlink to the Account table)
  • Contact (Set up column format as Auto and enter formula =FINDROW(Contact,"Contact[Account]=%",[Account])
  • In my example I did not set the contact as a RowLink because that information is already related to the account and there's no need to have the user manually select the contact because there's only one contact per account. It makes more sense to have it as a calculation for display purposes only.

FindRow

I hope this helps solve your issues.

Best Regards,

Nancy

Moderator note: Edited out personal information.

To answer your second question about adding a column for inserting images. Currently this feature is not available in HoneyCode but I've seen other users post it as a feature request :slight_smile: I'm also very eager to have this feature!

A work a around could be storing the link to the image. Although that doesn't solve the issue of seeing the image directly in the app.

thank you so much mam, Only last thing I wanna ask What if I want one to many relationship i.e. one account has multiple contacts.... Because In my another project I have to use that relation.

And It will be a great pleasure, if you gave me best tutorial that teach me properly how to use honeycode...I had gone through the documentation but still I am having many doubts.
Once Again thank you

The good news is the relationship we already setup allows for 1 to many between the Account and Contact table. The foreign key or to use HoneyCode terms the RowLink should always be placed on the many side.

For example if the business rule is one Account can be linked to multiple Contacts the foreign key/RowLink goes on the many side which is the contact table. Another example would be if you had a sales team and each sales rep is assigned to multiple accounts then in the Accounts table you would add a RowLink to the SalesRep. I hope that helps lead you in the right direction.

The only variation will need to make to our table structure is in the Pipeline table. Now that one Account can have multiple Contacts will need the user to assign a contact based on the selected Account. Will need to change the Contact column in the Pipeline table to a RowLink and use a filter which limits the contacts picklist based on the related account.

Once you've updated the Contact column if an account is related to multiple contacts those contact will display and the user can select which contact they'd like to assign.

Nanc-5d83_1

Here's the data I have in the Contacts table

Nanc-5d83_2

I hope my guide is helpful.

Best Regards,

Nancy

Moderator note: Edited out personal information.

Mam , I followed each and every step carefully.But still It is showing an error "Picklist is no longer linked to a source.Link to a source and try again".

. And I want to ask another question that if both tables are getting reference from each other then which table should be filled first.I think you got confused in the thing (contact table contains account column whereas Account table contains contact column).

Hey @Aman-1039,

So here's something interesting that I found and perhaps it's a bug with HoneyCode. If you recall in the pipeline table we initially had the Contact column with the format set to Auto and setup a formula doing a "=FINDROW(Contact, "Contact[Account]=%, [Account]) however after further discussion you stated an Account can be associated with multiple Contacts. We then changed the Contact column in the Pipeline table to be a filtered RowLink. Oddly enough I was also getting the error you described. I've used the same Filter RowLink in other solutions which worked perfectly fine.

For testing purposes I created a new table called NewPipeline and created the following fields:
-Deal Name
-Account
-Primary Contact

Account Format Settings:

Primary Contact Format Settings:

Results:
PrimaryContacts

As a reminder when you are setting a column as a RowLink click on the column header then click on the "Formats" button.

As for your second question "And I want to ask another question that if both tables are getting reference from each other then which table should be filled first .I think you got confused in the thing (contact table contains account column whereas Account table contains contact column)."

It all depends on the screen workflow you're designing. In terms of creating the Pipeline records the records in the Account and Contact table should be populated first. That will ensure the picklist display properly. This is a general approach however you can streamline this process by giving the user the ability to select from a list of existing contacts related to the selected account or create a new contact.

BTW in terms of the relationship between the Contact table and the Account table you mentioned a contact is associated with one account, and one account can be associated with multiple contacts. If that is still true then the foreign key/RowLink to create that relationship needs to be setup in the Contact table. In the Contact table you need a column for the Account and have it setup as a RowLink.

I hope this helps.

@Aman-1039

My apologies for all the back and fourth but I just noticed the issue in your screenshot, it looks like you typed in the formula at the individual field level. If so remove the formula then...

  • Click on the Contact column header

  • Click the Formats button on the tool bar

  • Under the Column Properties following the settings on the screenshot below

1 Like