cancel
Showing results for 
Search instead for 
Did you mean: 

Reference Entire Record in ForAll

In ForAll we are in a record context, but what if we want the entire record? I would suggest that "ThisItem" or some other identifier for the entire record. It's very inconvenient and change-intolerant having to reference each field specifically when I want to patch every record in one collection to another.

ForAll(
     Collection,
     Patch(DataSource, DataSourceRecord, ThisItem)
)
vs.

ForAll(
    Collection,
    Patch(DataSource,

        DataSourceRecord,{

        Field1:Field1,

        Field2:Field2,

        Field3:Field3,

        Field4:Field4,

        Field5:Field5

    })

)

 

I mainly want to use this to sync an offline collection with a sharepoint list. The collections have exactly the same structure. The behavior *could* include matching records by ID when no "DataSourceRecord" is specified (and generate IDs for new records created with Defaults(DataSource)), but even without that this would be so much cleaner.

 

Another syntax (with automatic ID-matching) for collections of identical structure might be:

Patch(DataSource, Collection)

 

Or specify a match method (with Collection names to avoid naming collisions):

Patch(DataSource,Collection,DataSource[@ID]=Collection[@ID])

 

Status: New
Comments
Level: Powered On

A really annoying omission.  Surely can't be that difficult to correct?