Hi All,
I am fetching data from an Azure SQL Server into a PowerApps Collection. To ensure that this is dynamic, I am using the method which is mentioned in this link .
My Azure SQL Table has 40 columns whereas I need to select only a few columns into the canvas app. While using the method in the link above, I add an additional step of adding ShowColumns, in addition to filtering the data, but somehow, all the columns get added to the collection and data gets filled for the two columns that I add in ShowColumns -
Set(
firstRecord,
Min(
SQLTable,
New_ID
)
);
Set(
lastRecord,
Max(
SQLTable,
New_ID
)
);
Set(
iterationsNo,
RoundUp(
(lastRecord - firstRecord) / 500,
0
)
);
ClearCollect(
TestCollection1,
Sequence(
iterationsNo,
0
)
);
ForAll(
TestCollection1,
With(
{
prevThreshold: Value(Value) * 500,
nextThreshold: (Value(Value) + 1) * 500
},
If(
lastRecord > Value,
Collect(
TestCollection,
ShowColumns(
Filter(
SQLTable,
New_ID > prevThreshold && New_ID <= nextThreshold
),
"New_ID",
"Account_ID"
)
)
)
)
);
I tested adding a simple collection and it fetched only two columns into the collection -
ClearCollect(TestCollect_A,ShowColumns(SQLTable,"New_ID","Account_ID"))
How do I ensure that I get only 2 columns into the collection? I have set the "Explicit Column Selection" setting to "True" as well.
Please advice!

Report
All responses (
Answers (