Home >Tips >Power Apps >Survey - 6, mood selector component kalmstrom.com site map icon Site map  

Create a Powerapp Survey based on SharePoint

Mood Selector Component

Microsoft Power Apps iconIn the previous demo, Peter Kalmström, CEO and Systems Designer of kalmstrom.com Business Solutions, showed how to create a survey progress bar in the form of a pie chart.

Here, Peter continues the powerapp survey series with a demonstration on another kind of graphics: emoiji indicators of mood or feeling. These emojis are included in Power Apps, so Peter only needs to connect them to the survey question. As in the earlier demos he works with one of the questions/data cards.

It is not possible to insert a component in a data card, so instead, Peter creates a Moods collection with the five mood emojis and connects it to a horizontal gallery inside the data card. As he is working with question number 3, he names the gallery galMood3.

In the gallery, Peter inserts another, more available icon. Then he sets the Icon and Color properties of this icon to the icon values of the Moods collection.

Steps

  1. In Power Apps Studio, App Onstart, create a collection of the different moods after the Set formula:ClearCollect(Moods, {Number:1,Icon:EmojiSad,Color:Red});
  2. Copy the formula exept Clear and and paste it four times in the formula bar.
  3. Modify the pasted formulas, so that the numbers are 2-5 and the colors and emojis are different.
  4. Run the code at App OnStart.
  5. Insert a blank horizontal gallery in the data card. Drag the icon inside the template.
  6. Set the Items property for the gallery to the new collection, Moods.
  7. Insert any icon in the gallery and adjust size and position of the icon and gallery.
  8. Set the Icon property of the icon to ThisItem.Icon. This will give the icons from the Moods collection.
  9. Set the icon property Color to ThisItem.Color.
  10. Set the background fill to light grey if the icon is selected. Keep the default formula but include it in an If function: If(ThisItem.IsSelected,RGBA(211,211,211,1),RGBA(0,0,0,0))
  11. Set the data card value field to the number that was selected in the gallery:galMood3.Selected.Number.
  12. Hide the field.
Add the gallery to more data cards by copy and paste, and set the value field in each pasted gallery to the selected number in that gallery.



Learn more





back icon next icon
Products Buy FAQ Services Tips Books Contact About Us Tools

Security and integrity

Copyright  Kalmstrom Enterprises AB  All rights reserved