How to pouplate data in an lookup entity

How to pouplate data in an lookup entity

  
- Create an action like:
PopulateCity {
1 - Query (All City)
2 - If Not Query.Empty 3 - Stop
4 - Assign (Query.current.City.Id=IntToEntityRefInt(1); Query.current.City.Name=Lisbon)
(TIP: no need to use a record local variable, we can use query.current even if it is empty)
5 - CreateCity (Source=Query.current)
(...repeat 4-5)
}
- Select Insert->System Actions->On Session Start from menu
- Drag the PopulateCity action to the OnSessionStart flow
The attached file shows an example.
A better solution in more complex eSpaces would be to leave this PopulateCity action in a backoffice explicit button.
As you state, this type of initializations should not be done on each session start. Please always use an explicit screen / backoffice for this.

Also, if you have a big number of rows, you may use the ExcelToRecordlist node and then iterate the resulting recordlist, updating the database.