cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bryan
Level: Power Up

Newbie and need some help setting up a survey

Hey guys,

 

I am using the employee engagement survey as a template to create a quick survey and I'm a little bit stuck!

 

I am trying to find out how to name the options in the radio funtion, instead of just 1, 2, 3 etc! First time using PowerApps so any help would be appreciated 🙂

7 REPLIES 7
Anonymous
Not applicable

Re: Newbie and need some help setting up a survey

Hi @Bryan,

 

The radio buttons generate options based on the data source. By default, it is connected to RadioSample data source which has two values 1 and 2.

2.png 

 

If you want custom options:

  1. Open Excel
  2. Enter your values in table like structure
  3. Format as table (very important PowerApps only takes tables)
  4. Change the table name
  5. Save the excel sheet with any name (excel sheet name not important only the table name matters)

3.png

 

Open PowerApps and go to the data sources (you can find it by clicking on your radio buttons and selecting Content -> Data Sources. On the right-side panel click Add data source, find Add static data to your app Import from Excel. Find your Excel file, select it, it will ask which tables from the sheet you want to import. Select your table.
4.png

 

Select your radio buttons control and in the Items function replace RadioSample with your table name and the options will be there.

5.png

Spectrumzx
Level: Powered On

Re: Newbie and need some help setting up a survey

Hi 

I'm also trying to reverse engineer this form but cant figure what formula is required for skip logic. I have 2 radiio buttons yes and no and need to action the following..

 

If yes selected get 'yes' and add to table

If no selected get 'no' and add to table

 

Then i have a next button...

 

When button pressed look up radiio button selected and navigate to screen_no or screen_yes

 

screen_yes continues survey 

 

screen_no  asks more questions then continues survey

 

Total newbie so any help appreciated .

 

Thanks

Anonymous
Not applicable

Re: Newbie and need some help setting up a survey

HI @Spectrumzx
Here is the sample how to implement something like you described:

 

FIRST SCREEN

 10.png

First on your first screen (Screen 1) have some user input, and Yes/No selection. Create the button which will do the following:

  1. Collect the information user inputted
  2. Decide which screen to go to next.

Here is the formula of the button:

ClearCollect(SurveyData,{Name:TextInput1.Text, RadioQuestion:Radio1.Selected.Value,Additional:"",FinalInfo:""} );

If(Radio1.Selected.Value = "Yes", Navigate(YES_Screen,ScreenTransition.Fade),Navigate(NO_Screen,ScreenTransition.Fade) )

 

It has two parts. The first one:

ClearCollect(SurveyData,{Name:TextInput1.Text, RadioQuestion:Radio1.Selected.Value,Additional:"",FinalInfo:""} );

Creates a collection which will be used to collect user input locally and after you can push this to your database, SharePoint list, etc. You have to declare all possible variables at this stage (my survey has 4 – Name, RadioQuestion, Additional, and FinalInfo. You will have to put all variables from your survey)

Second part:

If(Radio1.Selected.Value = "Yes", Navigate(YES_Screen,ScreenTransition.Fade),Navigate(NO_Screen,ScreenTransition.Fade) )

Checks if yes or no is selected and brings the user to different page (either NO or YES screen).

 

NO SCREEN

11.png

 

NO Screen has one additional input field and the button. Button has the following function:

Patch(SurveyData,First(SurveyData),{Additional:TextInput1_1.Text});

Navigate(YES_Screen,ScreenTransition.Fade)

It also has two parts. First one:

Patch(SurveyData,First(SurveyData),{Additional:TextInput1_1.Text});

Updates the collection with the value entered into the additional field.

 

Second part:

Navigate(YES_Screen,ScreenTransition.Fade)

Navigates to the YES screen

 

YES SCREEN
12.png

It has one final field to enter information. Its button has a very similar formula to the NO Screen:

Patch(SurveyData,First(SurveyData),{FinalInfo:TextInput1_2.Text});

Navigate(Screen2,ScreenTransition.Fade)

 

That is pretty much it I have a final screen which just displays all the information entered, you can use it to verify input. Also you can add a button which on action would use Patch() to put the info in CDS, SharePoint list, or excel file.

 

SCREEN 2
13.png

 

Hope this helps 🙂

Spectrumzx
Level: Powered On

Re: Newbie and need some help setting up a survey

Hi MJ

 

Thanks very much for your reply....really useful info and i'm a little wiser now, however i'm still struggling.

 

Existing in app before i edit....

 

Questions

LookUp(Questions,QuestionId="4").QuestionText

 

Radio Buttons

Items - Filter(Options,QuestionId="4")

On select - If(Radio1_1.Selected.OptionText="Yes",UpdateContext({error_v:false}));UpdateContext({error4_v:false})

 

Next Button

If(IsBlank(Radio1_1.Selected.OptionText),UpdateContext({error4_v:true}),If(IsBlank(TextInput1.Text) && Radio1_1.Selected.OptionText="No",UpdateContext({error_v:true,error4_v:false}), Navigate(Question_5, ScreenTransition.Fade,{ans4:Radio1_1.Selected.OptionText,reason:TextInput1.Text})))

 

I know this opens a text input if no is selected but i need to remove this also.

 

What is the difference in clearcollect and updatecontext if any ?

 

thanks

 

 

Anonymous
Not applicable

Re: Newbie and need some help setting up a survey

Hi @Spectrumzx

 

Context variables (Update Context) are only available in the current screen and they can not be accessed in another screen (unless you send the context in the Navigate() function).

 

Collections are global variables and they can be accessed from any screen and reset only when app is closed.

 

Sorry I did not really get your problem with the button? Maybe some screenshots can help.

Spectrumzx
Level: Powered On

Re: Newbie and need some help setting up a survey

MJ,

 

original app shots

 

What im trying to achieve

 

Thanks for your patience

Spectrumzx
Level: Powered On

Re: Newbie and need some help setting up a survey

Sorry...try this link

 

shots

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,642)