Allow a user to only update one column

How do i accomplish the following: I have rows of data and as an example, I want a logged in user to be able to change the information in column1 (in this case, the number 10), but not in columns 2 or 3. there are several rows of data but they can only change the row that’s specific to them? Does that make sense?

Name Column1 Column2 Column3
John 10 20 30

Question: What about other users? Should they be able to see but not edit, or not see at all?

No, other users can see all the info in the table. I just want the logged in user to be able to change one column that relates to their information.

So one column, in one row?

Let’s deal with the row first: as long as you have something in that row that identifies the user, then you can put a condition on editing such they can only edit when that matches. For example, lets say you have their email address in one column, then your condition would be “email is signed in user”. If you have their name, then it might be “Name is User Profile → Name”.

For the column, you can configure your edit form so that there will only be an input component for that specific column. That will work okay if all users are editing the same column. If they are editing different columns, then it gets quite a bit more complicated, and I’d start questioning whether your data is structured in the best way.

All users will be able to update the same column so that;s fine.
For information, I’m displaying the data in a data grid. I tried turning edit on and setting the condtion for only the one column however, it was letting me edit the entire table.

Also, I never saw the option for condition “email is signed in user”. I haven’t added their email information yet to the table. Is that why?

ah, Data Grid.

No, sorry you can’t do that with a Data Grid. Many of us would love it if you could :slight_smile:

If you want that level of control, you’ll need to use a different Collection style. Maybe a List or Table.

I suppose what you could do is filter the Data Grid based on the User, in which case they would see only one row, which they could edit. But that wouldn’t meet your goal of allowing all users to see all data.

Or you could use two Data Grids - one that’s editable but only shows a single row, and a second that shows all rows, but isn’t editable.

1 Like

That’s okay. I can create a new tab that only shows the information I want them to change. There are calculation that are performed depending on what they change the value to.
As long as I can use a list to filter out and only show that information (and allow edits), that will achieve my goal.

What would be ideal is if I could show that data in the user profile screen and get them to change it there but I can’t sho infomation from 2 different tables in the one screen.

Yes you can :slight_smile:

Sounds like you might have started with a “Screen from Data” option when you created the screen?
That gives you just a single collection, but you can add more components if you want. You can add as many as you want. If you add more collections, they can source any table in your App.

Sorry for the late response. What you’ve said is ideal. I will experiment with that.

Again, the advice has been invaluable. I managed to link the info from another table and allow editing of only one column depending on the logged in name. It seems to work a treat.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.