Update rows in a table

How do we update a subset of rows within a table?

In 6.15 adding a “Where” clause after a With, allowed for this. In Connect the Where clause is being applied on the creation of the table instead of the update.

Example:
//6.15
//Orders - contains multiple orders
let myTbl = Orders with [comments: ‘order selected’] where IsSelected = ‘True’;
return myTbl;
//returns a table containing all 20 orders but updates comments on selected orders

in Connect when I run this (replace the [ ] with { }), it returns me a table that only contains records that meet the where clause.

The with...where construct in Flow Classic was syntactically ambiguous, so in Flow Connect you use instead the when keyword.

let myTbl = Orders with {comments: 'order selected'} when IsSelected = 'True';
return myTbl;

For more examples, here’s a link to the documentation on this.

1 Like

Ah it is no longer a table but a sequence. Using “when” worked, thanks!