Hello, Folks
Is there a way to make this syntax work within a ClearCollect, or Collect function?
ClearCollect(colLocationList,
ForAll(Sequence(16), {LSD_Values:Text(Value)}),
ForAll(Sequence(36), {SEC_Values:Text(Value)}),
ForAll(Sequence(126), {TWP_Values:Text(Value)})
);
I'm trying to collect multiple columns of different sequenced values in one function... This syntax is accepted but only the first column returns values when executed:
Any thoughts?
Thanks!
Solved! Go to Solution.
Hmmm, this should work?
ClearCollect(
colLocationList,
ForAll(
Sequence(126),
If(
Value <= 16,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
If(
Value <= 36,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
}
)
)
)
)
My Bad, Use this one as the answer. I messed up the edit's, first one did all numbers, just needed blanks in there instead if you haven't figured that out already, here is working code.
ClearCollect(
colLocationList,
ForAll(
Sequence(126),
If(
Value <= 16,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
If(
Value <= 36,
{
LSD_Values: "",
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
{
LSD_Values: "",
SEC_Values: "",
TWP_Values: Text(Value)
}
)
)
)
)
As for the 0's gonna be something in the Text() function I think can handle that let me fiddle.
Ok, upon further evaluation it looks like the function IS collecting each sequence, but instead of starting at the first row in the collection (for each new column), it is adding the preceding sequence number of empty values into that corresponding column... so SEC_Values column has 16 blank fields before the (36) number sequence starts.. That is unexpected behavior... Any ideas?
Hmmm, this should work?
ClearCollect(
colLocationList,
ForAll(
Sequence(126),
If(
Value <= 16,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
If(
Value <= 36,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
}
)
)
)
)
Ops, I mean this 😛
ClearCollect(
colLocationList,
ForAll(
Sequence(126),
If(
Value <= 16,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
If(
Value <= 36,
{
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
{
TWP_Values: Text(Value)
}
)
)
)
)
Brilliant @cwebb365 ... Wrapping my brain around this Powerapp syntax is crazy, I appreciate your approach, it worked exceptionally!
Can you think of a way for me to add "0"'s to the TWP_Values record so that double digit #'s would show a single "0" preceding the value, and single digit #'s would show "00" preceding the value?
Haha... woops I think I jumped the gun... First solution just listed all numbers in each column (to 126)
Second solution only showed first set of numbers and didn't add the other columns!..
My Bad, Use this one as the answer. I messed up the edit's, first one did all numbers, just needed blanks in there instead if you haven't figured that out already, here is working code.
ClearCollect(
colLocationList,
ForAll(
Sequence(126),
If(
Value <= 16,
{
LSD_Values: Text(Value),
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
If(
Value <= 36,
{
LSD_Values: "",
SEC_Values: Text(Value),
TWP_Values: Text(Value)
},
{
LSD_Values: "",
SEC_Values: "",
TWP_Values: Text(Value)
}
)
)
)
)
As for the 0's gonna be something in the Text() function I think can handle that let me fiddle.
Ok so for the 0's, use Text(Value,"0#") for the TWP Values. You can do leading 0's, only need it for the first IF statement since after the first group you won't need it in the rest.
Yes @cwebb365 !! You did it! Thank you so much! That allowed me to filter and add the zeros where required.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
178 | |
45 | |
44 | |
33 | |
33 |
User | Count |
---|---|
255 | |
82 | |
78 | |
67 | |
65 |