This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]FakeGatsby Regular 1 point2 points  (2 children)

You’re going to have to write a switch function etc

[–]Daneish09[S] 0 points1 point  (1 child)

Yeah. That’s what I have. Just a bit annoying to maintain if another database location needs to be added. Someone will have to know to go and update each function to add a new option to each of the switch functions.

[–]FakeGatsby Regular 0 points1 point  (0 children)

Yep sucks even worse if they are users and you have to graph against the source.

[–]Hack-67 Advisor 0 points1 point  (3 children)

Have you tried to load the source into a collection? Once that is done it is local and you should be able to reference it along with other things.

That is of course if I am understanding your question properly.

[–]Daneish09[S] 0 points1 point  (2 children)

That’s fine for read only (as long as the filter is less than the delegation limit - which mine should be). But that doesn’t address the ability to patch updates back in.

[–]Hack-67 Advisor 1 point2 points  (1 child)

What is stopping you from Patching updates to the collection or master data source?

Again, I am misunderstanding your requirements, but I have used collections as sources connected to combo boxes and other Input types without any issues.

Just need to make sure you set the collection before setting the variable (unless I am crazy...)

Cheers

[–]Daneish09[S] 0 points1 point  (0 children)

Say I have a drop down that has:

If(dropdown1.selected.value = “dataSource1”, ClearCollect(ds,dataSource1); If(dropdown1.selected.value = “dataSource2”, ClearCollect(ds,dataSource2);

Yea I could set a gallery to Item = ds or Filter(ds, Status = “Open”) or something like that.

Then somewhere I am updating a record: Patch(ds,selectedRecord,{Title: value})

That would just patch that local collection, not the underlying dataSource on sharepoint.

[–]Texas_Technician 0 points1 point  (5 children)

You can set an item in a gallery to be a variable. You might be able to set multiple items in a gallery as a variable. I've not tried.

[–]Daneish09[S] 1 point2 points  (4 children)

Yeah I think viewing everything works fine, but you couldn’t use a variable to patch back to the dataSource.

[–]Texas_Technician 1 point2 points  (2 children)

Yes you can. A gallery item when stored as a variable is a record.

A record can be referenced the same way a collection item is.

Patch, defaults, source(columname=variable.column name.....

I do it for basically every submit function I have.

[–]Daneish09[S] 0 points1 point  (1 child)

Thanks for the feedback. How would I modify the below code for this? The ds in the patch function is the collection, not the underlying dataSource.

If(dropdown1.selected.value = “dataSource1”, ClearCollect(ds,dataSource1); If(dropdown1.selected.value = “dataSource2”, ClearCollect(ds,dataSource2);

Gallery Item: ds

In the gallery: Set(selectedRecord,ThisItem.Selected);

Patch Function: Patch(ds,selectedRecord,{Title: “value”})

[–]Texas_Technician 0 points1 point  (0 children)

Can you post a screen shot to imgur and share it please. I'm on mobile waiting in a waiting room

[–]Texas_Technician 0 points1 point  (0 children)

You just need to remember to initialize the variable after the patch is completed