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;
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.
@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.
@Aleksi_Alkio I will try and inform after I enjoy beautiful ISTANBUL traffic jam
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โ )
@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๐
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
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โ )
User | Count |
---|---|
43 | |
30 | |
24 | |
23 | |
13 |