I have some many-to-many relationships where I use Ref_Rows to find the related records:
This referaence gives me the correct records:
While, this is not giving the correct records:
The two expressions give the same output, but is referring to different values in the relationship table.
The Key is the UniqueID and there is no Label column.
What am I doing wrong?
Hello @HCF, The Ref_Rows simply returns the list of rows that have a column with the same value as the key of the row the function is running on, the โContactsโ or โActivitiesโ columns are simply the names of the columns that are marked as references.
If both of your Ref_Row functions are running on a row with the same Key, and they are yielding the same result, then thatโs working as intended i believe.
Hi @Rafael_ANEIC-PY, is there a way to read through a many-to-many relationship if we can not do it with Ref_Rows() ?
A Ref_Rows() function can be equivalent to a Select() expression, as stated in the documentation:
REF_ROWS("Order Details", "Order ID")
is functionally equivalent to each of the following:
FILTER("Order Details", ([_THISROW] = [Order ID]))
SELECT(Order Details[Order Details ID], ([_THISROW] = [Order ID]))
.
So you could use it to read the information that you need between your tables, i could try to help you with the exact expression if you give me more insight on what exactly are you trying to achieve and the structure of your app
I have a Table Contacts and a Table Activities. Each Contact can have many Activities and each Activity can have many Contacts. In between, I have a help table that looks like this:
What I am trying to do, is to list the Contacts related to a certain Activity and vice versa.
If I have understood your requirement correctly,
[Related ActivityContacts] [ContactsAC]
Here [ContactsAC] is the ref column you have for [Contacts] in the table โActivityContactsโ I have purposely assigned a suffix AC to identify that this column belongs to ActivityContacts table.
[Related ActivityContacts] [ActivitiesAC]
Here [ActivitiesAC] is the ref column you have for [Activities] in the table โActivityContactsโ I have purposely assigned a suffix AC to identify that this column belongs to ActivityContacts table.
I get this error:
Please try with [Related ActivityContacts] as suggested
There should be no space here:
Please mention where you have used the expression. I believe you should have reverse reference columns titles something like [Related ActivityContacts] in both Contacts and Activities table.
The suggested VCs need to be in the contacts and activities table.
Contacts table VC expression :
[Related ActivityContacts] [ActivitiesAC]
Activities table VC expression
[Related ActivityContacts] [ContactsAC]
I have used the expression in a VC named Related Contacts in the Activities table and Related Activities in the Contacts table
So is it working now?
Could you please update the name of the system created reverse reference column names related to the ActivityContacts table in Contacts as well as Activities table?
OK, I renamed the columns back to their original names and inserted the expression, but get this error:
Please do not change the expression in the system created [Related ActivityContacts] column.
Please create new VCs as suggested, one each in Contacts table and Activities table and use the suggested expressions in their app formula.
I had suggested those to be different additional columns to be created with suggested names as below
Aaah, thanks for your patience, I finally get some result. However, the results display as a map which was not intended.
@Suvrutt_Gurjar - also, I see that from one of the lists in any view - itโs possible to use the View and Add commands. Add, adds a new blank record, but there is no way to add an existing record as I can see. Is this possible through Actions?
User | Count |
---|---|
37 | |
30 | |
29 | |
22 | |
18 |