I have one Parent table (named "Urunler") whi...

Yilmaz_Kandis
Participant III

I have one Parent table (named “Urunler”) which has key field as ‘idUrun’ and lots of other columns including ‘idUserEmail’ column. and Child table which has key value as ‘idDosya’ and has reference to parent via ‘idUrun’ column

How to make a Child Table ‘Read Only’ dependant on the values in ‘idUserEmail’ column in the Parent table?

I wrote an expression like this into Child table;

IF( ANY(SELECT(Urunler[idUserEmail], [idUrun]=[_THISROW].[idUrun],))=USEREMAIL(),

“ADDS_AND_UPDATES”, “READ_ONLY”)

but I receive error for above formula;

0 17 446
17 REPLIES 17

Bitmedi derdin, bitmedi​:joy: SWITCH (USEREMAIL(),

"administrator@mydomain.com","ALL

_CHANGES",

“READ_ONLY”)

SWITCH( USEREMAIL(), ANY(SELECT(Urunler[idUserEmail], [idUrun]=[_THISROW].[idUrun])),

“ADDS_AND_UPDATES”, “READ_ONLY” )

The table access is not the correct way because you want to change the access by field value. One possibe option is the Editable_If field.

Yilmaz_Kandis
Participant III

@Aleksi_Alkio Thanks! Editable_If works ok with my scenario but still want user not to be able to click on ‘New’.

Sometimes you want too much bro​:joy:

If you create an additional REF_ROWS slice and that slice is Read_Only, you can use Show_If expression to show that inline table or not. If you have two separate inline views (one for normal table and one for the slice) you can have the feature you are looking for.

Yilmaz_Kandis
Participant III

@Aleksi_Alkio I will try and inform after I enjoy beautiful ISTANBUL traffic jam

Yilmaz_Kandis
Participant III

Hello sensei @Aleksi_Alkio it worked. Ref_Rows to a ‘Read Only’ slice and setting its Show_If helped me solve my problem. Thanks to you as well dear @Levent_KULACOGLU

You’re welcome

SWITCH( IN(USEREMAIL(),Urunler[idUserEmail], TRUE, “ADDS_AND_UPDATES”, “READ_ONLY” )

Yilmaz_Kandis
Participant III

@Levent_KULACOGLU Selam Üstad, I got the same error for your formula; SWITCH( USEREMAIL(), ANY(SELECT(Urunler[idUserEmail], [idUrun]=[_THISROW].[idUrun])),

“ADDS_AND_UPDATES”, “READ_ONLY” ) … Error in expression ‘[_THISROW].[idUrun]’ : Unable to find column ‘_THISROW’, did you mean ‘Tür’?.. …

@Yilmaz_Kandis1 try the last one😉

Yilmaz_Kandis
Participant III

@Levent_KULACOGLU

When I try the last one; SWITCH( IN(USEREMAIL(),Urunler[idUserEmail]), TRUE, “ADDS_AND_UPDATES”, “READ_ONLY” ) It doesn’t give error but it also doesn’t perform what I want.

I have ‘Files’ Child table for each ‘Urunler’. I want the user to add/update Files only if the Urunler is added by the user. In your formula, it compares UserEmail() to whole Urunler[idUserEmail]. If the user has only one record belong to him then for all records he will have Add_And_Updates. Isn’t it?

@Yilmaz_Kandis1 you can assign/revoke access on table level, not on row level

Yilmaz_Kandis
Participant III

This was the answer I was wishing not to get. Thanks bro!

@Yilmaz_Kandis1 you can achieve a result, provided you use a full slice of your table as per USEREMAIL(), then users can see only their own data. But let’s consult our “Master” @Aleksi_Alkio, may be he offers something more useful or operational than mine.

@Yilmaz_Kandis1 try this one also… SWITCH( USEREMAIL(), [MotherRecordRefColumnName].[ChildRecordEmailColumn], “ADDS_AND_UPDATES”, “READ_ONLY” )

Top Labels in this Space