I have an app that has been working perfectly using the sliders using this patch when submitting the form:
Patch('SPListName', Defaults('SPListName'), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1: Slider1.Value, Column2: Slider2.Value, Column3: Slider3.Value});
Reset(Slider1); Reset(Slider2); Reset(Slider3);
Set(varScan, Blank());
Navigate(HomeScreen)
I am wanting to change the sliders to individual buttons with the selected button populating the column. I tried placing the buttons for the column in a container and tried this patch:
Patch('SPListName', Defaults('SPListName'), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1: Column1Container.Value});
Set(varScan, Blank());
Navigate(HomeScreen)
Any advice would be appreciated!
Solved! Go to Solution.
Hi Inelse,
Since you work with sliders, I presume these values:
0 = Intervene
1 = Acceptable
2 = Independent
OnVisible property of the Screen:
// Setting values to standard value 1, Acceptable
UpdateContext({
_category1: 1, // Preparation & Knowledge
_category2: 1, // Clinical Skills
-category3: 1}) // Time Management
Per categoryname (Preparation&Knowledge; Clinical Skills, Time Management) you have three buttons:
In the OnSelect of the Buttons: (example here: category1, just adapt for category2 and category3)
Button Intervene:
UpdateContext({_category1:0})
Button Acceptable:
UpdateContext({_category1:1})
Button Independent
UpdateContext({_category1:2})
BorderThickness Button (to indicate which one is selected):
Button Intervene:
If(_category1 = 0, 2, 0)
Button Acceptable:
If(_category1 = 1, 2, 0)
Button Independent
If(_category1 = 2, 2, 0)
Your Patch function:
Patch('SPListName',
Defaults('SPListName'),
{BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName,
Column1: _category1, Column2: _category2, Column3: _category3});
// Reset to standard value
UpdateContext({_category1:1, _category2:1, _category3:1})
Hope this helps,
Marc
Hi Inelse,
Since you work with sliders, I presume these values:
0 = Intervene
1 = Acceptable
2 = Independent
OnVisible property of the Screen:
// Setting values to standard value 1, Acceptable
UpdateContext({
_category1: 1, // Preparation & Knowledge
_category2: 1, // Clinical Skills
-category3: 1}) // Time Management
Per categoryname (Preparation&Knowledge; Clinical Skills, Time Management) you have three buttons:
In the OnSelect of the Buttons: (example here: category1, just adapt for category2 and category3)
Button Intervene:
UpdateContext({_category1:0})
Button Acceptable:
UpdateContext({_category1:1})
Button Independent
UpdateContext({_category1:2})
BorderThickness Button (to indicate which one is selected):
Button Intervene:
If(_category1 = 0, 2, 0)
Button Acceptable:
If(_category1 = 1, 2, 0)
Button Independent
If(_category1 = 2, 2, 0)
Your Patch function:
Patch('SPListName',
Defaults('SPListName'),
{BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName,
Column1: _category1, Column2: _category2, Column3: _category3});
// Reset to standard value
UpdateContext({_category1:1, _category2:1, _category3:1})
Hope this helps,
Marc
Tried this-
OnVisible property of the screen:
UpdateContext({_category1:2,
_category2:2,
_category3:2})
In the OnSelect of each button:
UpdateContext({_category1:1}) and so forth…
In the BorderThickness for each button. I wanted it to be a little thicker. Which it does, however, it doesn’t do it when you select the button, it does it for the last item when you select the next item.
If(_category1 = 1, 10, 0)
Patch function:
Patch('SPListName’, Defaults(‘SPListName’), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1:_category1, Column2:_category2, Column3:_category3, Comments:CommentInput.Text});
Set(varScan, Blank());
UpdateContext({_category1:2, _category2:2, _category3:2});
Navigate(HomeScreen)
If I take out the Column information everything else populates the SP list. As is, it doesn’t allow me to submit.
Button selection BorderThickness resolved - moved to FocusBorderThickness.
I modified the patch to this and it works! Thanks for pointing me in the right direction.
Patch function:
Patch('SPListName’, Defaults(‘SPListName’), {BarcodeScanned:varScan, WhenScanned:Now(), WhoScanned:User().FullName, Column1:Value(_category1), Column2:Value(_category2), Column3:Value(_category3), Comments:CommentInput.Text});
Set(varScan, Blank());
UpdateContext({_category1:2, _category2:2, _category3:2});
Navigate(HomeScreen)
User | Count |
---|---|
252 | |
106 | |
94 | |
50 | |
39 |