cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misc
Resolver III
Resolver III

Pull out a collection from plaintext column on edit form

My latest app uses a collection to assign a number of unique sample IDs to the ticket raised. 

reference collection.png

This works fine, as you can see above. This collection is then concat'd together to write to the data source. 

 

 

If(TicketForm.Mode = FormMode.New, Concat(SampleID, Sample_ID & "/" & Your_Ref & "; "), PlainText(Parent.Default))

 

 

My question comes in when I then allow users to view, and potentially edit their previously submitted ticket. I essentially want to 'recollect' the data in the 'SampleID' column into a collection so it will be visible in the gallery as above. I guess I need to have some sort of mix of Split, Left, and Right to do it but I can't seem to work it out.

 

So in short, I need to change a string of text which looks like 

 

​CSM-1-A/1; CSM-1-B/12; CSM-1-C/123; CSM-1-D/1234;

 

Into a collection which looks like

Sample_ID

Your_Ref
CSM-1-A1
CSM-1-B

12

CSM-1-C123
CSM-1-D1234

 

Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @misc 

Something along the lines of this should work for you:

AddColumns(Split("CSM-1-A/1; CSM-1-B/12; CSM-1-C/123; CSM-1-D/1234;", ";"),
           "Sample_ID",First(Split(Result, "/")).Result,
           "Your_Ref",Last(Split(Result, "/")).Result
           )

 

timl_0-1635767662480.png

 

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @misc 

Something along the lines of this should work for you:

AddColumns(Split("CSM-1-A/1; CSM-1-B/12; CSM-1-C/123; CSM-1-D/1234;", ";"),
           "Sample_ID",First(Split(Result, "/")).Result,
           "Your_Ref",Last(Split(Result, "/")).Result
           )

 

timl_0-1635767662480.png

 

misc
Resolver III
Resolver III

Thank you! I added that on the edit form icon and it worked once I added in the collect again,

Collect(SampleID,AddColumns(Split(DataCardValue17.Text, ";"),
           "Sample_ID",First(Split(Result, "/")).Result,
           "Your_Ref",Last(Split(Result, "/")).Result
           ))

 

Much appreciated!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (7,636)