SET data-store with server-connect data (similar to SET function of local storage)

Need the ability to “set” data store with array of records from serverconnect data without looping through all records & binding every field between the two.

Simple flat data scenario - Let’s say I have a serverconnect returning data of a schema of 50 fields. Say, there are just 10 records of these.

With a local storage, where I have already defined the schema of the same 50 fields (similar to the serverconnect schema), it takes a simple straight-forward “set” function to set the local storage with the serverconnect data.

{{local_storage1.set('my_orders', serverconnect.data.my_orders)}}

where ‘my_orders’ in the local_storage is an array of 50 fields

In order to achieve the same with a data store (which apparently uses local storage under the hood), I have to use a repeat on the serverconnect and map all 50 fields once again to set the values of the data store like this:

repeat: {
	repeat: "{{serverconnect.data.my_orders}}",
	exec: {
		steps: {
			run: {
				action: "{{datastore1.insert( {
					field1: field1,
					field2: field2,
					field3: field3,
					field4: field4
                    //.....list all the 50 fields
				}
			)
		}
	}
	"
}
}
},
name: "repeat1",
	output: true
}

This is very counter-intuitive & imagine if I have to change the schema, I have a third spot to deal with, especially within this tiny screen.

Nested data scenario - The “set” method of local_storage works beautifully even with nested data as long as the schema between serverconnect & local-storage array matches, but with data store, here are the additional complexity:

  • have to use nested repeat (2 levels)
  • list all fields on both levels
  • the data picker screen can’t handle nested data inserts into data store, it simply doesn’t show the second level at the moment (discussed here - Arrays within data store)

Please bring “set” function to data store which is available with the underlying local storage.

This also perfectly solves the use case of setting an array of objects between serverconnect & datastore where the data-picker is unable to deal with arrays

The need of this have been discussed in various datastore-related threads like:

Using A Flow To Fill A Data Store From The Database,
Copy Database Table Record to Data Store,
Set Data Store Value/Array from query in Server Connect,
A bit of guidance needed - Datastore to server action,
Flows and Datastores,
Struggling with Data Storage