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 / Detail view of a share...
Power Apps
Unanswered

Detail view of a sharepoint field

(0) ShareShare
ReportReport
Posted on by 909

Hello,

 

I have this function

 

If(
 User().Email in Split(
 ThisItem.'Kto polubił';
 ";"
 );
 Notify("Możesz polubić propozycję tylko raz."; NotificationType.Error);
 Patch(
 IdeaBox_1;
 ThisItem;
 {
 Polubienia: ThisItem.Polubienia + 1;
 'Kto polubił': ThisItem.'Kto polubił' & ";" & User().FullName & ";" & User().Email
 }
 ))

 

As you can see Kto polubił field stores users full name and email when button is clicked. It is saved - when another user clicks it it then stores his date as well it is this format

;Name;Email;Name;Email

 

I would like to create a gallery/data table with this data and show it as a different record.

 

I created a gallery2 and in Text I provided ThisItem.'Kto polubił'

 

It shows record like that:

;Name;Email;Name;Email

 

They are all showed as one record. It doesn't look good.

Also this function shows ; before the first name.

 

Is it possible to make a gallery that will show data like that:

Who liked?

1. Name, Email

2. Name, Email

3. Name, Email

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Elitezone 

    For your formula, consider the following change:

    With({users: Split(ThisItem.'Kto polubił'; ";")};
     
     If(User().Email in users;
    
     Notify("Możesz polubić propozycję tylko raz."; NotificationType.Error);
     
     Patch(
     IdeaBox_1;
     ThisItem;
     {
     Polubienia: ThisItem.Polubienia + 1;
     'Kto polubił': With({data: Concat(users, ";")};
     If(!StartsWith(data, ";"); data) & User().FullName & ";" & User().Email
     )
     }
     )
     )
    )

    This will remove the ";" at the start of your data.

     

    If you can, I would *highly* recommend that you change your delimiters.  Trying to separate a ";" list of values into two items per each row (for your Gallery) is a challenge that would require another step (i.e. a button or other control to instantiate a collection).

     

    If you can make your list in this delimited format :   name;email|name;email  (notice the | between each name and email record), then you can set your Gallery Items property to:

    AddColumns(
     Split(yourdata, "|");
     "name"; First(Split(Result; ";")).Result;
     "email"; Last(Split(Result; ";")).Result
    )

    - Replacing "yourdata" with whatever you are using to get to the source of the 'Kto polubił' column.

     

    Then in your Gallery you can reference ThisItem.name and ThisItem.email as you might want.

     

    I hope this is helpful for you.

  • Elitezone Profile Picture
    909 on at

    @RandyHayes 

    When I change language my delimeter stays the same.

    Also when I change it it will require my whole application to be rewritten?

     

    I do not know if I understand this well, but shouldn't it be possible to make a connection with another sharepoint list.

     

    In a main sharepoint list I would have fields ID, Name of proposition, Description, Likes, Who liked.

    Who Liked would be lookup to a different list that would store details about likes.

    Name of person who liked, date of like, ID of item that was liked (connection with ID)

     

    With this I could also get a data of date of like and then filter it in PowerApps.

    Do I understandard this correctly?

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Elitezone 

    My apologies that I do not understand your response.

    I am not sure what you mean about changing language.  My suggestion is that you separate the name/value pairs with another delimiter.  This way you can split on the Name/Value record pair delimiter "|" and then for each pair, you can split on the individual name/value pair ";"

    This would be immensely easier to then do what you are trying to do.  Otherwise, you will need a separate formula on an action that would then collect ever other item and its value.

     

    Yes, you can connect to as many SharePoint lists as you want - but I'm not sure what that has to do with the issue at hand.  Apologies if I am misunderstand, but your original question had to do with creating a separate Gallery from the split results of the data column that had delimited information?

    Are you now saying that you are storing the "like" information in a separate list?  It appeared that you were storing it in the Kto polubił column.

  • Elitezone Profile Picture
    909 on at

    @RandyHayes 

    I thought that you meant the global delimiter which for Poland is ; and other country is , 

     

    And this sharepoint list is just my proposition for the solution - I thought that this might work and be efficient (it would store date of like given). 

     

    I am using function that was mentioned above.

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Elitezone 

    No, I was talking about the delimiter between your name/value pairs in your data.  Certainly can't change the delimiters in your formula editor 😉

     

    So, where are you at this point?  Is your issue resolved or are you struggling still?

  • Elitezone Profile Picture
    909 on at

    @RandyHayes 

    Randy you are frying my brain ;D

     

    With({users: Split(ThisItem.'Kto polubił'; "|")};
    If(User().Email in users;
     Notify("Możesz polubić propozycję tylko raz."; NotificationType.Error);
     Set(varRecord;Patch(
     IdeaBox_1;
     LookUp(IdeaBox_1;ID=ThisItem.ID);
     {
     Polubienia: ThisItem.Polubienia + 1;
     'Kto polubił': With({data: Concat(users; "|")};
     If(!StartsWith(data; "|"); data) & User().FullName & "|" & User().Email)
     }
     ));If(!IsBlank(varRecord);Notify("Propozycja została polubiona!";NotificationType.Success))))

    As a pessimist I tried it in many ways - it seems to be working. Sometimes Success Notification is just slow.

    I noticed that my function had Error message for the same event twice so I cutted it from the last function.

     

    I tested button at now it 1. does not have a delimeter at beginning 2. it does have delimiter | between records.

     

    I set Items of gallery that I wanted to use for who liked:

    AddColumns(
     Split(Gallery2.Selected.'Kto polubił'; "|");
     "name"; First(Split(Result; "|")).Result;
     "email"; Last(Split(Result; "|")).Result
    )

     Does not produce errors.

     

    I have also modified Title of gallery field that has before ThisItem.Kto polubił to ThisItem.name or ThisItem.email.

    It produce results, but they are listed one after another and the first field of gallery is blank.

    I'll show you screen to make it more visible:

     

    Elitezone_0-1601453965842.png

    No matter if I pick e-mail or name - it always show them one under another. 

    How to make it work like that?

    Elitezone_1-1601454130690.png

     

    In my best case scenario WhoLiked (Kto polubił - should have a connection to a field WhenLiked). I would love to have a table with NAME/EMAIL/WHEN LIKE.

    But I have no idea how to connect WhoLiked with WhenLiked (how to make a relationship with them).

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Elitezone 

    I think you might have misunderstood what I was saying on the delimiters.  What I am suggesting is that you have "records" of Name/Value pairs.  The idea here is to separate the "records" by a different delimiter than the name/value pairs:

     

    Name;Value|Name;Value|Name;Value

     

    The formulas will not work unless you follow the records separators "|" and the Name/Value separators ";" as shown above.

     

    Review the formulas that I suggested to you.  Those DO follow the separations as mentioned.

  • Elitezone Profile Picture
    909 on at

    Seems like I have fixed a problem in gallery:

    AddColumns(
     Split(Gallery2.Selected.'Kto polubił'; ";");
     "name"; First(Split(Result; "|")).Result;
     "email"; Last(Split(Result; "|")).Result
    )

    Now it shows result well (I fabricated some results).

     

    I have however problem with function that provides likes. I tried to set it up in many ways but it always work bad. 

    When I change parameter | ; it sometimes show in sharepoint:

    ;;;;;;;name

    and when I change it somewhere else it delete saved sharepoint record and replace it with a new one...

     

    With({users: Split(ThisItem.'Kto polubił'; ";")};
    If(User().Email in users;
     Notify("Możesz polubić propozycję tylko raz."; NotificationType.Error);
     Set(varRecord;Patch(
     IdeaBox_1;
     LookUp(IdeaBox_1;ID=ThisItem.ID);
     {
     Polubienia: ThisItem.Polubienia + 1;
     'Kto polubił': With({data: Concat(users; ";")};
     If(!StartsWith(data; ";"); data) & User().FullName & "|" & User().Email)
     }
     ));If(!IsBlank(varRecord);Notify("Propozycja została polubiona!";NotificationType.Success))))

    - this allows for infinity amount of likes

    With({users: Split(ThisItem.'Kto polubił'; "|")};
    If(User().Email in users;
     Notify("Możesz polubić propozycję tylko raz."; NotificationType.Error);
     Set(varRecord;Patch(
     IdeaBox_1;
     LookUp(IdeaBox_1;ID=ThisItem.ID);
     {
     Polubienia: ThisItem.Polubienia + 1;
     'Kto polubił': With({data: Concat(users; "|")};
     If(!StartsWith(data; "|"); data) & User().FullName & "|" & User().Email)
     }
     ));If(!IsBlank(varRecord);Notify("Propozycja została polubiona!";NotificationType.Success))))

    This deleted all previous Kto polubił and add current user who clicked.

     

    Please provide some instructions.

  • Elitezone Profile Picture
    909 on at

    @RandyHayes 

    Still haven't figured it out. Please help me.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Elitezone 

    Sorry for delay...

     

    So I'm confused as to what you are doing in the formula.  You seem to be splitting the column by either | or ; but that is only PART of what you need to do.  If your column is in the name;value|name;value  format, then you need to split not only once but twice.  Once to separate the name;value pairs and then again on each to separate the name from the value.

    You first need to establish what your standard format will be - will you separate name/value pairs by | or ; ?  Then whichever you choose there, you will use the other to separate the name from the value.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard