cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JackieM
Frequent Visitor

Check boxes, collections and strings oh my. (canvas app)

I've been working on producing a solution that allows users to check as many check boxes as they like. Each checkbox ticked clear collects a collection as well as being used as a boolean for a free text box next to it. (the data entered into the text box is also entered into the collection)

OnCheck and OnUncheck of the each checkbox

 

 

ClearCollect(SelectedCorpPlan,
{Plan:If(Community.Value,"Community"),PlanDetail:If(Community.Value,TextInput9.Text)},
{Plan:If(Customer.Value,"Customer"),PlanDetail:If(Customer.Value,TextInput9_1.Text)},
{Plan:If(ValueForMoney.Value,"Value for money"),PlanDetail:If(ValueForMoney.Value,TextInput9_3.Text)},
{Plan:If(ITAndTechnology.Value,"IT and Technology"),PlanDetail:If(ITAndTechnology.Value,TextInput10.Text)},
{Plan:If(Leadership.Value,"Leadership"),PlanDetail:If(Leadership.Value,TextInput9_2.Text)},
{Plan:If(People.Value,"People"),PlanDetail:If(People.Value,TextInput9_4.Text)})

 

 

Visible for the free text

 

 

ITAndTechnology.Value

 

 

OnChange for free text

 

 

ClearCollect(SelectedCorpPlan,
{Plan:If(Community.Value,"Community"),PlanDetail:If(Community.Value,TextInput9.Text)},
{Plan:If(Customer.Value,"Customer"),PlanDetail:If(Customer.Value,TextInput9_1.Text)},
{Plan:If(ValueForMoney.Value,"Value for money"),PlanDetail:If(ValueForMoney.Value,TextInput9_3.Text)},
{Plan:If(ITAndTechnology.Value,"IT and Technology"),PlanDetail:If(ITAndTechnology.Value,TextInput10.Text)},
{Plan:If(Leadership.Value,"Leadership"),PlanDetail:If(Leadership.Value,TextInput9_2.Text)},
    {Plan:If(People.Value,"People"),PlanDetail:If(People.Value,TextInput9_4.Text)}
)

 

 


This collection is then ConCat into a string and saved into a list along with other data entered into the form.
Update for Data card (text input)

 

 

Concat(SelectedCorpPlan,Plan &" | "& PlanDetail & ".", Char(10))

 

 


String created example with community,Value for money and IT and Technology tickboxes checked and Test1/2/3 entered as free text.
Community | test1.Customer | test2.Value for money | test3.IT and Technology | test4. | . | .


This all works lovely, and creates a nice string, yum yum.

When viewing the form, the string is then broken down back into a collection via Forall and split and is used to repoulate the collection.

 

ClearCollect(
    SelectedCorpPlan,
    ForAll(
        Split(
            TextInput11.Text,
            "."
        ),
        {
            Plan: Left(
                Result,
                Find(
                    " | ",
                    Result
                )-1
            ),
            PlanDetail: Mid(
                Result,
                Find(
                    " | ",
                    Result
                )+3
            )
        }
    )
)

 

 


The checkbox defaults then use an IF and lookup to see if they are true or false (ticked or unticked)

 

 

If(LookUp(SelectedCorpPlan,Plan = "IT and Technology",Plan) = "IT and Technology",true,false)

 

 


This all works beautifully in the Development but once it sits in sharepoint as a form it doesn't work as intended...

Is there anything glaring i am missing ?


Images of the results in attached.

 
 
0 REPLIES 0

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (36,879)