I have a gallery called MyGallery where the user will select some data. There are a fields in the gallery. Let's call them MyGalleryData1 and MyGalleryData2.
And there are a couple fields I want the user to input outside of the gallery after selecting an item in the gallery. Let's call them Input1 and Input2.
I want to collect all the data from both the gallery and the inputs into a collection called MyCollectedData.
I'm using this formula OnSelect for a button to collect the data.
Collect(MyCollectedData,{Item1:MyGallery.Selected.MyGalleryData1,Item2:MyGallery.Selected.MyGalleryData2,Item3:Input1.Text,Item4:Input2.Text})
Is there a way to reference the all the items in a selected gallery? My gallery actually has a dozen or so items, so I don't want to individually specify them 1 by 1 in the collect formula.
I know that if I don't have the other inputs and just want to collect the gallery I could use this formula.
Collect(MyCollectedData,MyGallery.Selected)
And this would collect all the columns of data from the gallery's data source. Is there a way to add the inputs to this simple formula?
Solved! Go to Solution.
I was able to use this formula to accomplish the goal.
Collect(MyCollectedData,AddColumns(Table(MyGallery.Selected),"CollectedInput1",Input1.Text,"CollectedInput2",Input2.Text))
But it seems like there should be a more simple way without needing to convert the selected gallery item to a table then add columns to the table.
Hoping there's a more elegant solution.
I was able to use this formula to accomplish the goal.
Collect(MyCollectedData,AddColumns(Table(MyGallery.Selected),"CollectedInput1",Input1.Text,"CollectedInput2",Input2.Text))
But it seems like there should be a more simple way without needing to convert the selected gallery item to a table then add columns to the table.
Hoping there's a more elegant solution.
Thanks for sharing your solution, always glad to see people come back and let us know how they solved things,
I would have solved it a similar way, and there's definitely a Longer way (referencing individual columns of myGallery.Selected), and as for shorter, your solution seems like one of the shorter ways to me 🙂
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
183 | |
106 | |
88 | |
44 | |
43 |
User | Count |
---|---|
226 | |
108 | |
105 | |
68 | |
68 |