Hiya
I am trying an experiment. I have a client operating in a mine site in the middle of nowhere. Internet access is not guaranteed in certain areas of the site.
With that in mind, I have a SharePoint list with columns
Title, AuditType, ControlType, Width and ControlData
All, apart from the Width column are strings at present.
The Title column represents a question, ControlType can be "TextBox", "DropDown", etc
The intent of this list is that it contains a master list of questions, and the app chooses a subset of those questions based on certain criteria (using AuditType). This list has to work in offline scenarios, so I pull this data into a local collection and use SaveData(), just in case the workers are in an area with no wifi/internet.
I then put in a vertical Gallery on the page and set items to filter(MasterQuestions,AuditType=<audit>) and add a textbox and a drodown control to it. Each control is on top of the other (same XY position) I then set the visible property of the textbox and dropdown to:
if(thisitem.ControlType="TextBox",true,false
if(thisitem.ControlType="DropDown",true,false
I set the width property to thisitem.Width
This has the intended effect... the control I want to use is displayed in the gallery. But I was hoping to set the items property for the dropdown to thisitem.ControlData and store this in JSON format in SharePoint. Then I was hoping to use table() function to create it in the format that dropdown.items expects... ie
DropDown1.Items = table(thisitem.ControlData)
Unfortunately this does not work. I get the error "Cannot use a non-record value in this context".
Unfortunately I cannot use an EditForm because that can only bind to a live datasource and I need to use an in-memory collection as I described above.
Any ideas how I can achieve the end of a gallery with dynamic controls on it without using a dataform? In effect I am emulating that the data form does except against a collection
regards
Paul
I think this could not achieve so far..
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 2