i'm going to start from the very beginning of what i'm doing, so if i'm making this way too complicated someone can tell me.
i'm making an app that's a directory of parts where i can also create bills of materials and view them. when viewing a BOM, i want to see a list of all the required parts and be able to click them to open the info for that particular part. i have the part directory finished and i know how to do the last bit with clicking through to part info, but i'm running into some problems displaying the bill of materials.
here's how i'm making and saving them:
so the record looks like this in the BOM entity:
here's where the problem comes in. when i view the BOM, i want to see the parts and their quantities in a gallery -- to do that, i need to split both of these strings and make them into a 2-column collection?
this is my onvisible for the BOM view page and the resulting collections:
so, in theory, all i need to do is combine both of these collections into one 2-column collection, then put that into a gallery. i can't figure out how to do that without ending up with at least one column being a nested table. can someone help?
Solved! Go to Solution.
Hello cyarbrough,
Maybe not the easiest way but until we find it you can use this:
ClearCollect(counter,0);
Clear(Combined);
ForAll(bomparts,
Collect(counter,Last(counter).Value+1);
Collect(Combined,{
bomparts:Last(FirstN(bomparts,Last(counter).Value)).Result,
bomquan:Last(FirstN(bomquan,Last(counter).Value)).Result
}))
Hi @cyarbrough,
This means that you need to join columns from 2 data sources in one gallery, please take below thread as reference and see if this could help:
Regards,
Mona
Hello cyarbrough,
Maybe not the easiest way but until we find it you can use this:
ClearCollect(counter,0);
Clear(Combined);
ForAll(bomparts,
Collect(counter,Last(counter).Value+1);
Collect(Combined,{
bomparts:Last(FirstN(bomparts,Last(counter).Value)).Result,
bomquan:Last(FirstN(bomquan,Last(counter).Value)).Result
}))
thanks, mike8. i figured out how to get everything working how i wanted based on the formula you gave me.
Thank you. I have spent quite some time trying to figure out similar problem, and then your solution popped out working like a charm. Cheers.
Hello, does the funciton that a colleague placed only return the last record in the table ?