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 🙂
Hi @Anonymous,
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.
If you want custom options:
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.
Select your radio buttons control and in the Items function replace RadioSample with your table name and the options will be there.
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
HI @Spectrumzx
Here is the sample how to implement something like you described:
FIRST SCREEN
First on your first screen (Screen 1) have some user input, and Yes/No selection. Create the button which will do the following:
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
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
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
Hope this helps 🙂
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
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.
MJ,
original app shots
What im trying to achieve
Thanks for your patience
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
203 | |
46 | |
45 | |
45 | |
39 |
User | Count |
---|---|
280 | |
81 | |
80 | |
80 | |
68 |