Choice - Multi-Select - Update Item vs REST vs Set Field Value
Greetings,
This is an odd scenario, and yet again, it involves the limitations of iPads, but the potential answer(s) could be very useful for many other situations.
Basically, for a Choice Column with multi-selection (checkboxes) enabled, I am trying to figure out how a Button click Action can: keep it's current value(s) and add a new value. [Append, basically.]
Example: MultiChoice column has a value of "Status 1, Status 4". After clicking a button, I want the value to be "Status 1, Status 4, Status 2". [It keeps the current value(s), and appends the new value(s).]
I have found that Set Field Value & Update Item both wipe out the current value(s). I have used Set Field Value to solve almost this identical problem, using something like this:
Visibility for 'Progress Image 3'
However, in the current situation, things aren't quite as "linear". The choices aren't linearly progressing & the end user could need add (make visible) fields in semi-infinite combinations.
In the current situation, the options look like this:
Any suggestions on possible options here? If REST is the answer, is there a nuanced approach to use? Or if REST, would Patch vs. Merge factor into this? Am I missing different approaches with Update Item or Set Field Value?
As always, I appreciate your time,
Taylor
-
Instantly after posting...
Would a Get Items Action, to retrieve the current value(s), prior to the Update Item action step, potentially be a solution here? (The Update Item action would include the value(s) retrieve from the previous Action plus the new value that is to be set.)
0 -
I have attempted all seemingly possibilities I found here on there forums [Variables, execute script, QueryList, GetValuesForQuery, etc] without much luck.
The closest I have gotten is using Get Items, followed by Update Item, but I am running into an [Object object] issue. I am guessing I need to parse the array in someway.
This is how it currently looks:
Get Items CAML + test results
Update Item
Before Action Button Click
After Action Button Click
The desired output would be:
ReworkImage2, DelayImage1, DelayImage2, ReworkImage1,AddWorkImage1, AddWorkImage2, Test1Image1, Test3Image1Any suggestions?
0 -
Hi Taylor
In general you'll get returned an array of object from the Get items action which you can loop over with the Loop: apply to each action or by your custom javascript code.
Check the action output by log it into the console like this:console.log([[@Actions.Get_items.Items]]
Loop over the action output with custom code like this to concatenate some column values (i.e. the Title):
[[@Actions.Get_items.Items]].map(item => item.Title).join(', ');
0
Please sign in to leave a comment.
Comments
3 comments