web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to update a substr...
Power Apps
Answered

How to update a substring in a string in an array of strings

(0) ShareShare
ReportReport
Posted on by 143

Hello All,

 

I have a datasource which contains a column -"Summary" against each Project example like below:

ProjectSummary
ABCISS-00012 : Completed ; SCP00001 : Not Applicable ; QM7484474 : Plan TBD ; SCP00004 : Not Applicable ; QRCM7556800 : Not Applicable ; 
XYZISS-00012 : Agree not to fix ; SCP00001 : Planned ; QM7484474 : Plan TBD ; SCP00004 : Completed ; QRCM7556800 : Not Applicable ; 
RSTISS-00012 : Blocked ; SCOOP00001 : Not Applicable ; QM7556800 : Not Applicable ; QRCM7484474 : Plan TBD ; SCP00004 : Not Applicable ;

I have two gallerys, where first part of summary Id's matches (ISS-00012 will be present in two gallerys). Now I want to create a drop down when ISS-00012 is selected in first gallery I want to save relevant status for that ID from second gallery.

I mean if I select one status for one Issue-ID then it should either add newly or replace the current status of that issue-ID.

 

ISS-00012 : Completed; Now lets say this goes and store inside the first row of Summary column against project ABC. 

RMeena_9_0-1698678835373.png

1. Similarly, I need to update the status for other Issue-IDs as well in against same project ABC. And this repeats for other projects rows and its IDs +status. Is there is any way to find solution for this?

2. And if I want to replace that current status of "ISS-00012 : Completed "with "ISS-00012 : Blocked". what is the logic for it without disturbing other IDs in that row ??

 

I tried below logic but whatever I do the whole "Summary" column first row data is getting replaced with only one ID+status out of 10 IDs+Status.

 

Patch(
PrjFile_1,
SecondGallery.Selected,
{
Summary: Substitute(LookUp(Split(ThisItem.Summary," ; "),FirstGallery.Selected.'Issue-ID' in Value,Value),
Mid(ThisItem.Summary,Find(FirstGallery.Selected.'Issue-ID'&" "&":"&" ",ThisItem.Summary)+Len(FirstGallery.Selected.'Issue-ID'&" "&":"&" "),
Find(" ; ",ThisItem.Summary,Find(IFirstGallery.Selected.'Issue-ID'&" "&":"&" ",ThisItem.Summary)+Len(FirstGallery.Selected.'Issue-ID'&" "&":"&" "))-(Find(FirstGallery.Selected.'Issue-ID'&" "&":"&" ",ThisItem.Summary)+Len(FirstGallery.Selected.'Issue-ID'&" "&":"&" "))),
ComboBox2_1.Selected.Status)
}
)

 

I am not sure how to fix this. Any help would be of greatly appreciated.

@WarrenBelz , @FLMike : have you gone through this kind of problem statement ??

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @RMeena_9 ,

     

    I have made a test with the first item in your Gallery.

     

    Before updating:

    vjefferni_3-1698741662823.png

     

    after:

    vjefferni_2-1698741618299.png

     

    The status of project in the Label1 changed to the value in Label2.

     

    Formula OnSelect:

    ClearCollect(
     colTemp2,
     ForAll(
     Split(
     Gallery1.Selected.Summary,
     ";"
     ),
     {
     C1: First(
     Split(
     ThisRecord.Value,
     ":"
     )
     ).Value,
     C2: Last(
     Split(
     ThisRecord.Value,
     ":"
     )
     ).Value
     }
     )
    );
    Patch(
     colTemp2,
     LookUp(
     colTemp2,
     FirstGallery.Selected.'Issue-ID' in C1
     ),
     {C2: ComboBox2_1.Selected.Status}
    );
    Patch(
     colItems,
     Gallery1.Selected,
     {
     Summary: Concat(
     ForAll(
     colTemp2,
     {
     Value: Concatenate(
     ThisRecord.C1,
     ":",
     ThisRecord.C2
     )
     }
     ),
     Value,
     ";"
     )
     }
    )

     

    Best regards,

  • RMeena_9 Profile Picture
    143 on at

    Hello  @v-jefferni ,

    Thank you for providing the solution. It worked but I need to adapt this logic a little to change or add new issue id's dynamically since this column cell data increases. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard