Hello,
I'm developing an app...and i have some issues that i can't fix it..
I have a string (from sharepoint list) and I have to transform this string in a collection...with the columns "Disciplina", "Premissas", "Fora do Escopo" e "Obrigações do Cliente"...sometimes this string will only have one register for each column, but sometimes it can be more...like this example below...
my intention is using this collection in a gallery
Thank you so much!!!
It worked! Great!!! Thank you so much 🙂
Ok so to test this I put your snippet in a label, Label3, and am running the code from a buttons onselect
You can use this to convert any string in that same format
Button OnSelect is
Clear(QueueCount);
Clear(checkout);
ForAll(Filter(Split(Label3.Text, "<br>"),!IsBlank(Result)) As checkDown,
If(Left(checkDown.Result, 11)="Disciplina:", Collect(QueueCount,{Value:1}));
Collect(checkout, {Type: checkDown.Result, TypeCount: CountRows(QueueCount)})
);
ClearCollect(finalCollection,
ForAll(Sequence(CountRows(Distinct(checkout,TypeCount))) As recordCount,
{Disciplina: Substitute(LookUp(checkout, TypeCount=recordCount.Value && Left(Type, 11)="Disciplina:").Type, "Disciplina:",""),
Premissas: Substitute(LookUp(checkout, TypeCount=recordCount.Value && Left(Type, 10)="Premissas:").Type, "Premissas:",""),
'Fora de Escopo': Substitute(LookUp(checkout, TypeCount=recordCount.Value && Left(Type, 15)="Fora de Escopo:").Type, "Fora de Escopo:",""),
'Obrigações do Cliente': Substitute(LookUp(checkout, TypeCount=recordCount.Value && Left(Type, 22)="Obrigações do Cliente:").Type, "Obrigações do Cliente:","")}))
Final collection looks like
Hello,
The string in Sharepoint is like this:
Disciplina: Mecânica<br>Premissas: yyyyyyyyyyyyyyyyy<br>Fora de Escopo: zzzzzzzzzzzzzzzzzz<br>Obrigações do Cliente: kkkkkkkkkkkkkkkk<br><br>Disciplina: Civil / Concreto<br>Premissas: huahuehaehae<br>Fora de Escopo: uaeuehauehuaeh<br>Obrigações do Cliente: shuasuhashuashu<br><br>
I want a collection like this:
Disciplina | Premissas | Fora do Escopo | Obrigações do Cliente
Sometimes it can be 1 record for the Gallery, sometimes 2, 3, 4...depends! In this case we have two...But i need to set the powerapps to show the records in a gallery no matter how it'll be...1 or 1000 hahah 🙂
would this produce 2 records for your gallery, one for mecanica and one for civil/concreto that both have their own values for fora de escopo and premisas BUT share a value for obrigacoes do cliente?
if so, when multiple records are present in a single string will they always have their own of those 2 and share the same obrigacoes do cliente (if they do soemtimes share the first two, will they always be listed seperately as above, or will it sometimes be dropped to the end as a signel listing like the obrigacoes? are there other pieces of data that will ever be present. or is it just these three?
send an ecample of the splist displaying an item that only has one per column, and one that has 3 per columns, so we can differentiate between what happens to trigger both. what you have sent above is not enough information, it shows result of a multi entry one, but only the splist record of a single item with single entries on each column so it is unclear in your example why we would goto multiple items concatenated in the result
MS.Ragavendar
32
Rajkumar_M
16
Super User 2025 Season 1
mmbr1606
14
Super User 2025 Season 1