Hy,
I have a form (reference view) for adding new projects in a task management app.
In the form, when selecting the responsible person for the new project, there is a dropdown list with the names and pictures of the team. But there is also the possibility (action button) to add a new member of the team from here.
How can I make that button go away?
(or bonus - How can I make that button go away if the user is not admin?)
I want to remove it because I have a different form for adding new team members and I donโt want users to accidentally add new users when filling up the form for new projects.
( the app is not in english, but I hope thatโs not an issue for helping me find the settings to remove the button )
Thank you
Solved! Go to Solution.
I guess I could make a second table as a reference to the โResponsabilโ table and use it only for this view and make it read only for everybody, and then use the initial โRespnsabilโ table on the other view where I want the admin to be able to make changes and there use the expression you mentionedโฆIs this the cleanest way?
Hi @sorin_mihai, welcome! This article about the USERROLE() expression may be a helpful place to start - the first example it gives highlights how you specific user levels can be defined for allowing updates to a table (look for the โAre Updates Allowedโ field in each table): https://help.appsheet.com/en/articles/2357273-userrole
Hy, yes that is close. But this makes the rule for this table apply everywhere the table is referenced.
But I want it just for this view to not have the possibility to add a new team member. In this view, the dropdown should only be used to select one of the members as a Responsabil, not to create new ones. However, in a different view, the option to add new members must be open. Any way to control that Add New button, locally inside a view?
I guess I could make a second table as a reference to the โResponsabilโ table and use it only for this view and make it read only for everybody, and then use the initial โRespnsabilโ table on the other view where I want the admin to be able to make changes and there use the expression you mentionedโฆIs this the cleanest way?
@sorin_mihai Here is another workaround. In fact itโs just a fake
In the UX --> Localize go to โNewโ and enter an expression like:
IF(CONTEXT("View") = "Adaugare Project" , "" , "New")))
This would hide the word โNewโ in this particular view.
Interesting, good to know the mechanism, but itโs not of use for this particular application as I need the button to go away, not the word NEW
I would do the method of creating a slice to handle this, by creating a slice and setting the update permissions thereโฆ All of the mechanisms throughout app sheet are affected all at once and no need to go through an individually configure everything.
@Fabian the problem you might find here is that the Localize text is only calculated at certain times in the app - itโs not 100% dynamic. Another option would be to control the New buttonโs visibility by changing the action that controlโs it.
Fabianโs idea of using the CONTEXT() formula is a good one, just not used in the Localize space.
If you put Fabianโs formula in the condition for the add action of the table, that should give you contextual control over the add action and by specifying the view you wish the action to be available in it should give you the ability to show it where you want.
Hereโs a link to another article where we discussed how to affect the NEW button in length.
Another option could be to create your own user class system: you can find more on this thread.
Thatโs really good to know thanks for pointing it out.
The Responsibil column appears to be of type Ref. The presence of the New button in the drop-down menu is determined by the app userโs access to the table or slice the Ref values reference. Therefore, you can remove the New button by removing the userโs permission to add rows to the referenced table or slice.
You can conditionally affect a userโs permissionsโsuch as only allowing a row add if the user has the role of Adminโwith table permissions (the โAre Updates Allowedโ @Peter mentioned above; see Controlling Add, Update, and Delete).
Table permissions take effect wherever the table is used, including within slices. Slices, however, can be given their own stricter permissions (see Slices: The Essentials). A slice canโt have its own conditional permissions like a table can, though.
User | Count |
---|---|
32 | |
31 | |
30 | |
18 | |
17 |