I am now working on embed a list and library control in my form. But I want to hide some columns from the child list and only show some ones I need. I am now embedding a document library to my list and I want to hide the 'New Folder' button to avoid users to create too many folders in the target document library. For the document library, I have Document Name, Description, Remarks, Ref.ID columns. Ref.ID columns lookup to my form list ID. Now in my form, I only want to show Document Name and Description column in the list and library control.
How to hide the other columns and the new folder button within list and library control? I am quite new to Forms. Thanks for guidance.
And you can craete any list view with columns you want and display it in the form. For this in Data Source settings of the control select the desired view.
You can find all buttons in buttons property that holds them as an array of objects. To interact with the button, specify its index in the array.
Note, that the index count starts from 0.
For instance, if the source of the control is the Document library, control will have these buttons with the following indexes.
So, the Upload button index equals 0, and you need to use this code to hide it:
I looked at the documentation and don't see any mention of the ability to dynamically change the list/library control View shown in your screencapture in the Data Source Editor in Forms Designer. There's the ability to change the root folder of the list/library control and was wondering if there's such a thing to change the View dynamically as well?
Unfortunately, it is not possible to change the view dynamically.
Why do you need to change the view of List or Library control? Could you please describe the use case, maybe I can suggest something else. For instance, Form Sets that allows designing individual forms for users.
Use cases would be when there are many fields in a list and you want to provide different views for reporting purposes to show only certain fields based on what is needed to be seen.
In this case, you can either create a separate From Set for reporting purposes or add multiple List or Library controls with different views to the form and show/hide them dynamically.