cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Create an app for rating feature

Hi Folks,

 

I am new to powerapps and wanted to create an powerapp. I have few images in the sharepoint document libraries.

I am trying to create app which will display images from this document library one by one and want have option to rate the images from(1-5).

 

This app will be shared with around 30 people who will rate the images.

 

So finally I should get average rating for all images based on the ratings given by all users.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @rajp ,

Where do you store your rating record?

Do you want to create a Rating app using PowerApps to rate the each image in your SP Library?

 

Based on the needs that you mentioned, I think PowerApps could achieve your needs. Firstly, you need to create a data source (e.g. a SP List) to store the rating record your end users rate for your images.

 

On your side, you could consider add a SP list data source to store the Rating record your end users rate for your images. The data steucture of your SP list may look like below:4.JPG

Then you could configure your app as below:5.JPG

 

6.JPG

 

7.JPG

Add a Gallery control within your app, set the Items property of the Gallery to your SP Library.

Within the Gallery, add a Image control, set the Image property to following:

ThisItem.'Link to item'

Add a Rating control within your Gallery, set the Default property to 0, set the Max property to 5.

Outside the Gallery, add a Button control (called "Save") at the bottom, set the OnSelect property to following:

ForAll(                   /* <-- Save Rating records into your SP list */
       Gallery1.AllItems,
       Patch(
             'YourSPList',
             Defaults('YourSPList'),
             {
                 Title: "Rating Image App - " & Now(),
                 PictureName: 'File name with extension',
                 RatingValue: Rating1.Value
             }
       )
)

Then if you want to get the average rating for each Image file in your SP Library, you could take a try with the following formula:

Average(
            Filter('YourSPList', PictureName = "A specific image file name"),
            RatingValue
)

 

If you share your app with other users in your Org, when they run this app, they may not see these images within the Gallery. It is an known issue with images stored in SP Library that pictures that need authentication on SharePoint are not supported yet within PowerApps when running an app in Mobile device or other users run this shared app.

Please check my response within the following threads:

https://powerusers.microsoft.com/t5/Creating-Apps/Delegation-Warning-Use-of-Path-in-Gallery/m-p/2648...

https://powerusers.microsoft.com/t5/General-Discussion/App-No-Longer-Displaying-SharePoint-Images/m-...

 

As an alternative solution, you could consider create another SP list data source (not the above SP List to store your Rating records), and a Hyperlink column (Format url as Hyperlink) within it. Then copy URL link of the image files in your SP library, create corresponding record within your SP list and put the copied URL link within the Hyperlink column.

Within your app, use above new created SP list as data source instead of your SP Library, to display the images files within your Gallery.

 

As another solution, you could consider display thumbnail images of your Image files stored in your SP Library within your app. Please check and see if the following blog would help in your scenario:

https://www.chakkaradeep.com/2018/11/16/displaying-thumbnails-from-a-sharepoint-library-in-powerapps...

https://powerusers.microsoft.com/t5/PowerApps-Ideas/View-thumbnail-images-of-List-Item-Attachments-o...

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @rajp ,

Where do you store your rating record?

Do you want to create a Rating app using PowerApps to rate the each image in your SP Library?

 

Based on the needs that you mentioned, I think PowerApps could achieve your needs. Firstly, you need to create a data source (e.g. a SP List) to store the rating record your end users rate for your images.

 

On your side, you could consider add a SP list data source to store the Rating record your end users rate for your images. The data steucture of your SP list may look like below:4.JPG

Then you could configure your app as below:5.JPG

 

6.JPG

 

7.JPG

Add a Gallery control within your app, set the Items property of the Gallery to your SP Library.

Within the Gallery, add a Image control, set the Image property to following:

ThisItem.'Link to item'

Add a Rating control within your Gallery, set the Default property to 0, set the Max property to 5.

Outside the Gallery, add a Button control (called "Save") at the bottom, set the OnSelect property to following:

ForAll(                   /* <-- Save Rating records into your SP list */
       Gallery1.AllItems,
       Patch(
             'YourSPList',
             Defaults('YourSPList'),
             {
                 Title: "Rating Image App - " & Now(),
                 PictureName: 'File name with extension',
                 RatingValue: Rating1.Value
             }
       )
)

Then if you want to get the average rating for each Image file in your SP Library, you could take a try with the following formula:

Average(
            Filter('YourSPList', PictureName = "A specific image file name"),
            RatingValue
)

 

If you share your app with other users in your Org, when they run this app, they may not see these images within the Gallery. It is an known issue with images stored in SP Library that pictures that need authentication on SharePoint are not supported yet within PowerApps when running an app in Mobile device or other users run this shared app.

Please check my response within the following threads:

https://powerusers.microsoft.com/t5/Creating-Apps/Delegation-Warning-Use-of-Path-in-Gallery/m-p/2648...

https://powerusers.microsoft.com/t5/General-Discussion/App-No-Longer-Displaying-SharePoint-Images/m-...

 

As an alternative solution, you could consider create another SP list data source (not the above SP List to store your Rating records), and a Hyperlink column (Format url as Hyperlink) within it. Then copy URL link of the image files in your SP library, create corresponding record within your SP list and put the copied URL link within the Hyperlink column.

Within your app, use above new created SP list as data source instead of your SP Library, to display the images files within your Gallery.

 

As another solution, you could consider display thumbnail images of your Image files stored in your SP Library within your app. Please check and see if the following blog would help in your scenario:

https://www.chakkaradeep.com/2018/11/16/displaying-thumbnails-from-a-sharepoint-library-in-powerapps...

https://powerusers.microsoft.com/t5/PowerApps-Ideas/View-thumbnail-images-of-List-Item-Attachments-o...

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @v-xida-msft.,

 

Thanks for sharing this information and it was quite useful, After following the steps I was able to make it work, however when I shared it with other users few of them were able to see the images in Microsoft Edge browser, few in both Chrome and Edge but few could not see them in either of the browsers.

Not sure, what's going wrong here?

Thanks!

Hi @v-xida-msft.,

 

Thanks for sharing this information and it was quite useful, After following the steps I was able to make it work, however when I shared it with other users few of them were able to see the images in Microsoft Edge browser, few in both Chrome and Edge but few could not see them in either of the browsers.

Not sure, what's going wrong here?

Thanks!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (33,444)