cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Data table - thumbs up/like

Hello,

 

Is there any way to add a thumbs up/like/downvote section in a data table?

I would like my users to be able to vote for legal propositions that are being made.

 

I have a table with fields that are listed one below another. I would love to have added button Like/Dislike at the end of the table. Each user could vote once for a proposition or dislike it, and the points would be showed X likes Y dislikes.

 

Does it require new field? Can it be achieved with adding sharepoint data field yes/no? and using it with some buttons?

How can I check if user haven't voted for a proposition already, should I add 365 authentication or something?

When I send a proposition based on sharepoint list my name is already listed as a person who did a change. Maybe authentication is not required?

 

Could anyone provide some examples? 😉

I would be very grateful.

I would love to have such a rating table with a top5 (is there such a function)?

 

Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Elitezone :

Yes.You only need to nest another sort function outside the formula.Please try:

Sort(

Sort(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");Utworzony;If(SortDescending2;Descending;Ascending));

'Kto polubił';

Descending)

Best Regards,

BOf

View solution in original post

14 REPLIES 14
v-bofeng-msft
Community Support
Community Support

Hi @Elitezone :

I suggest you add two columns:

  • Thumbs(Number)-Used to record the number of likes
  • ThumbUser(Text)-Used to record users who liked

I'v made a test for your reference:

1\My data source-MYThumbTest()

ClearCollect(MYThumbTest,{Title:"Item1",Thumbs:0,ThumbUser:""},{Title:"Item2",Thumbs:0,ThumbUser:""},{Title:"Item3",Thumbs:0,ThumbUser:""})

 2\Add a gallery and set it's Items proeprty to

MYThumbTest

Add a "like" icon into this gallery and set it's OnSelect property to:

If(
    User().Email in Split(
        ThisItem.ThumbUser,
        ";"
    ),
    Notify("You already liked"),
    Patch(
        MYThumbTest,
        ThisItem,
        {
            Thumbs: ThisItem.Thumbs + 1,
            ThumbUser: ThisItem.ThumbUser & ";" & User().Email
        }
    )
)

15.gif

Best Regards,

Bof

 

@v-bofeng-msft 

Ok I have created today a gallery that list all of my sharepoint list record.

This gallery is using name, description field:

 

Elitezone_0-1600163682752.png

With a tutorial from Microsoft I have added to this gallery a search input text field that filter my records based on the "Name".

In Items field I have: 

 

Search(IdeaBox_1;SearchBox.Text;"Name")  (Name is in polish).

 

Is it possible to integrate Thumbs up with such a gallery? Or should be created a custom gallery.

Or your idea was to integrate gallery with a data table as a field in this table?

 

Would be grateful for your clarification.

 

Hi @Elitezone :

Is IdeaBox_1 your data source?

Please try:

1\Create Two columns in IdeaBox_1:

  • Thumbs(Number)-Used to record the number of likes
  • ThumbUser(Text)-Used to record users who liked

2\Set the Gallery's Items property to(I think the SearchBox should be outside the gallery instead of inside)

Search(IdeaBox_1;SearchBox.Text;"Name") 

3\Refer to my solution for the following steps.

Best Regards,

Bof

 

I tried to make it work, but I have some problems:

 

If(
    User().Email in Split(
        ThisItem.'Kto polubił';
        ";"
    );
    Notify("Już to polubiłeś");
    Patch(
        IdeaBox_1;
        ThisItem;
        {
            Polubienia: ThisItem.Polubienia + 1;
            'Kto polubił': ThisItem.'Kto polubił' & ";" & User().Email
        }
    )

 

I modified your formula but I get EOF error (ParenClose).

 

@v-bofeng-msft 

 

I have also no idea how to use this:

 

ClearCollect(MYThumbTest,{Title:"Item1",Thumbs:0,ThumbUser:""},{Title:"Item2",Thumbs:0,ThumbUser:""},{Title:"Item3",Thumbs:0,ThumbUser:""})

My gallery items property is like that:

 

Sort(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");Utworzony;If(SortDescending2;Descending;Ascending))

Hi @Elitezone :

You needn't use this formula(Because this is the collection I created temporarily for testing😞

ClearCollect(MYThumbTest,{Title:"Item1",Thumbs:0,ThumbUser:""},{Title:"Item2",Thumbs:0,ThumbUser:""},{Title:"Item3",Thumbs:0,ThumbUser:""})

Could you tell me whether these two fields have been added to the data source "IdeaBox_1"?What are their data types?

  •  Polubienia
  • 'Kto polubił'

Could you tell me what "EOF error" is? Could you provide some screenshots?

Best Regards,

Bof

Polubienia = Thumbs (amount of Thumbs up). Sharepoint field - Numeric

Kto polubił = ThumbUser (Users that liked this). Sharepoint field - Single line of text.

 

Elitezone_0-1600669243562.pngLiczba = Numeric, Pojedynczy wiersz tekstu = Single line of text

 

Error:

Elitezone_1-1600669899557.png

In short: Unexpected characters. The formula contains 'ParenClose' where 'Eof' is expected. This error occurs if, for example, a formula contains 'This error occurs if, for example, a formula contains '{Val@ 7}' instead of '{Val: 7}'. When you set a variable, the syntax requires a colon instead of an "at" symbol.

 

 

@v-bofeng-msft 

EDIT There was missing one ) at the end of formula. I added it, and it seems to work I guess!

Great as always.

 

I know I am asking for a lot but would you be some kind to help me a bit more?

I wish my gallery would have a default filter that would show most liked stuff at the top.

My current filters are like that:

 

Sort(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");Utworzony;If(SortDescending2;Descending;Ascending))

 

Is it possible to make a default filter that would show most like propositions at the top of gallery?

 

Hi @Elitezone :

Do you want to sort the records based on their matching degree?

Please try:

Sort(
   Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");
   If(SearchBox.Text = Nazwa;1;0)+If(SearchBox.Text = Opis;1;0);
   If(SortDescending2;Descending;Ascending))

Or

Sort(
   Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");
   If(SearchBox.Text in Nazwa;1;0)+If(SearchBox.Text in Opis;1;0);
   If(SortDescending2;Descending;Ascending))

Best Regards,

Bof

 

@v-bofeng-msft 

Maybe I explained it wrong. Let me paraphrase.

 

You helped me to introduce a Like button.

Now I would like to use this button as a default gallery filter.

 

So for example I have 50 records in gallery. And on top will be the one with 5 likes, second 4 likes, and the last one without likes.

It will sort them in accordance with the amount of likes that they have.

 

Is that possible?

 

@v-bofeng-msft 

Your function does not show any errors, would you be so kind to tell me what it changed in my app?

I cannot understand the changes it makes ;(

Hi @Elitezone :

Yes.You only need to nest another sort function outside the formula.Please try:

Sort(

Sort(Search(IdeaBox_1;SearchBox.Text;"Nazwa";"Opis");Utworzony;If(SortDescending2;Descending;Ascending));

'Kto polubił';

Descending)

Best Regards,

BOf

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (62,014)