I'm struggling with JSON and need some help! I've tried to follow other forum posts as much as I can but still seem to be getting stuck.
I need to pass a collection through to Flow in order to reopen archived records.
I have a gallery in my app with a checkbox on each item, when the box is ticked the ID number of that record is passed to a collection called MissedCollection.
This data is then passed to a Flow via the 'submit missed collection' button
LabWasteReopenArchive.Run(JSON(MissedCollection))
This then shows up in my flow which currently looks like this:
The 'Get Items' action isn't working as it should though because of the {"ID":... bit around the actual ID number. My question is I think two-fold:
1) Is this the best way to get the IDs for each ticked record?
2) If it is the best way - how do I either remove the extraneous code I don't want so the correct record can actually be found?
Thanks in advance!
Solved! Go to Solution.
You don't need a flow for this, you can just do it in the app. I would only consider making a flow if it will be a lot of items.
You can do something like:
ForAll(
Filter(
Gallery.AllItems,
Checkbox.Value=true
),
Patch(
DataSourceB,
Defaults(DataSourceB),
{
ColumnA: ThisRecord.ColumnA
}
)
)
And then:
ForAll(
Filter(
Gallery.AllItems,
Checkbox.Value=true
),
Remove(
DataSourceA,
ThisRecord
)
)
What does the reopen archived records look like? Maybe its kicking in open doors, but its always nice to check if a simpler solution is possible rather than trying to make a complex one work
It is a record in a sharepoint list. Essentially, users submit a record for their waste to be collected which goes into our 'Live list', each month this is collated and sent to our supplier. When the data is collated it is then deleted from the Live list, and created in the Archive list and the process begins again.
What I've done with other similar projects (but not exactly the same hence why I'm stuck!) is have users select a certain record and 'reopen it' which runs a flow to essentially Get Item > Create Item (in Live List) > Delete Item (from Archive list). My thoughts for this flow was:
1) Button in app triggers flow
2) Multiple records are pulled into flow via collection
3) Use the ID to Get Items
4) Create Item (in Live List)
5) Delete Item (from Archive List)
But as you can see from my initial post, I'm stuck on 3.
It's all just above moving records from one list to the other, essentially. I hope that answers your question!
So you select records in a gallery from list A, then you want to create an item in list B with those values, then remove the original item from list A that was selected in the gallery?
Yes - that's a much simpler way of putting it 🙂
You don't need a flow for this, you can just do it in the app. I would only consider making a flow if it will be a lot of items.
You can do something like:
ForAll(
Filter(
Gallery.AllItems,
Checkbox.Value=true
),
Patch(
DataSourceB,
Defaults(DataSourceB),
{
ColumnA: ThisRecord.ColumnA
}
)
)
And then:
ForAll(
Filter(
Gallery.AllItems,
Checkbox.Value=true
),
Remove(
DataSourceA,
ThisRecord
)
)
User | Count |
---|---|
88 | |
39 | |
23 | |
20 | |
16 |
User | Count |
---|---|
129 | |
50 | |
48 | |
35 | |
26 |