cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KennyDon
Level: Powered On

Create, View and Update results of Checkbox

Hi

 

My App uses the basic flow of opening screen with gallery to create and select records, an edit screen then another gallery screen with a Checkbox on it to record a number of possible outcomes and scores.

The checkbox get its values from a list

cbList.png

I have set the checkbox to be reset to false each time that screen becomes visible using the Onvisible property UpdateContext({ResetCheckbox:true});UpdateContext({ResetCheckbox:false}) then setting the Reset property of the checkbox to ResetCheckbox

I am successfully writing to 2 other lists. If I go back to my start screen and select an existing record I can successfully update the list results of the Edit form but as is expected my checkbox has been cleared. Is there any way to show the results form my List in the check box gallery so that I don't need to check all boxes again.

cbScreen.png

 

 

Off out for a well earned break now. 

Regards

 

Kenny

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Create, View and Update results of Checkbox

Hi @KennyDon ,

 

Could you please share more about your gallery and your form?

Is Title in your SP list is Single Line type or Choice?

What is the formula expression of your controls in your form?

I try to reproduce your situation and your issue on my side.

20190419checkboxdatasource1.PNG

20190419checkbox1.PNG

 

Best Regards.

Yumia

TopShelf-MSFT
Level 10

Re: Create, View and Update results of Checkbox

Thanks for posting in the community @KennyDon - can you review the above reply and update the thread when you have a chance? 

 

Thank you,

 

@TopShelf-MSFT 

KennyDon
Level: Powered On

Re: Create, View and Update results of Checkbox

Thanks for your response Yumia.

'Title' is single line text in the sharepoint list called TM_Pedestrian_Generators. The other field called PF_Score is used to apply a score to the value of the title. So if I select 'School Entrance' and 'Playground Entrance' my total score would be 30.

I have 2 other list that I am writing to. 'List A' accepts data into choices fields and depending on the choice selected applies a score. All these scores are added up and held in and held in a variable which is then written to my list.

Set (
varDetScore, varARVal + varPed16plusVal + varPed16minusVal + varTSVal + varTFVal + varGradVal + varFrontVal
);
UpdateContext({ResetCheckbox: true});
SubmitForm(editMainForm);

 

'List B' holds the result of each check box value and score. I use the following statement to add up all the values checked.

Set(varPedScore,(PF_Score+varPedScore));

OnSelect Check runs the following code:

RemoveIf(TM_Priority_Ped_Gen, SiteID = editMainForm.LastSubmit.ID);
ForAll(Filter(galPedGen.AllItems,chkPedGen.Value = true),
Patch(TM_Priority_Ped_Gen,Defaults(TM_Priority_Ped_Gen),
{
SiteID: editMainForm.LastSubmit.ID,
PedGenID: ID,
PedestrianGenerator: Title,
PFScoreVal: PF_Score
}
)
);
Set (varPedScore,Sum(Filter(TM_Priority_Ped_Gen,SiteID in Text(RecordID)),PFScoreVal));
Patch(TM_Prioritisation,First(Filter(TM_Prioritisation,ID = editMainForm.LastSubmit.ID)),

{
DetailScore: Value (varDetScore),
PedGenScore: Value(Ped_Gen_Score.Text),
TotalScore: Value(varDetScore) + Value(Ped_Gen_Score.Text)
}
);
Navigate(BrowseScreen1,Fade)

 

I think I need to add an If statement to check if a record exists. If it exists I do an update, if it does not exist I should create a new record.

The two lists I am writing to are related with a site ID. List A holds the unique site Name and Site ID and List B contains multiple scores based on the check box relating the each unique site.

Hope this makes more sense now.

Regards

Kenny

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,877)