Below is the code which i need to modify to make it dynamic, such that if User selects "Teams" table, then "Teams" associated primaryKey(variable), createdon, createdby, modifiedon and modifiedBy column data should be accessed and stored in tempTable. (Assume that all the mentioned columns are available in both/all tables)
If(Self.Selected.Value="Teams",Set(entityName,Teams),Set(entityName,Contacts));
ForAll(
entityName,
Collect(
tempTable,
{
name: ThisRecord.name,
createdOn: ThisRecord.createdon,
creatdBy: ThisRecord.createdby,
modifiedOn: ThisRecord.modifiedon,
modifiedBy : ThisRecord.modifiedby
}
)
);